Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
PHP
<blockquote class="quote"><div class="op">Quote:</div>
<?php
	session_start();
	if(!(isset($_SESSION['unm']) && $_SESSION['unm']!=''))
	{
		header('location:index.php?dp=4');
	}
	else
	{
		$unm=$_SESSION['unm'];
		
		$con=mysql_connect("localhost","root","");
		$db=mysql_select_db("Project_Interior",$con);
		
		$query="select snap,SUM(price) from cart";
		$result=mysql_query($query);
		
		while($row=mysql_fetch_array($result))
		{
			$totbill=$row['SUM(price)'];	
			$snap=$row['snap'];
		}
		
		$nameQuery="select name from register where email_id='$unm'";
		$nameresult=mysql_query($nameQuery);
		
		while($row1=mysql_fetch_array($nameresult))
		{
			$name=$row1['name'];
		}
		
		$insquery="INSERT INTO cus_order (name,snap,price) ('$name',(SELECT snap,price from cart))";
		$insresult=mysql_query($insquery);
		
	}
	
?></blockquote>
Posted
Comments
ChauhanAjay 10-Oct-14 13:34pm    
Does your register table and the cart table have any kind of relationship i.e., do they any columns which are common in them.
CHill60 10-Oct-14 14:37pm    
Try using the "improve question" ... put your question into the body of the post - it's been truncated - and choose an appropriate title

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900