<?php 
 session_start();
	if(isset($_SESSION['loginuser-id'])) {
	
	$s_id1 =$_SESSION['loginuser-id'];
	}
	else {
       $s_id1 = session_id();
	}

error_reporting(0);
if(isset($_POST['submit']))
{
include("connect.php");
$b_name=$_POST["b_name"];
	$b_fname=$_POST["b_fname"];
	
	
	$sql1="select * from mycart where c_s_id='$s_id1'";
	$res1= mysql_query($sql1);
	while($result1= mysql_fetch_array($res1))
	{
    echo  $C_name=$result1["c_name"];
	echo $C_price=$result1["c_price"];
	echo $C_img=$result1["c_img"];
	echo $C_quantity=$result1["c_quantity"];
	echo Order;
	echo $ord_id=$result1["order_id"];
	
	echo $C_p_id=$result1["c_p_id"];
	//$sql="insert into order(c_name,c_price,c_img,c_quantity,order_id,c_p_id,o_s_id,b_name,b_fname)
	//values('$C_name','$C_price','$C_img','$C_quantity','$ord_id','$C_p_id','$s_id1','$b_name','$b_fname')";
	
	
	$sql="INSERT INTO `ecommerce`.`order` (`c_name`, `c_price`, `c_img`, `c_quantity`, `order_id`, `c_p_id`, `o_s_id`, `b_name`, `b_fname`) VALUES ('$C_name', '$C_price', '$C_img', '$C_quantity', '$ord_id', '$C_p_id', '$s_id1 ', '$b_name', '$b_fname')";
	
	
	
	//echo $sql;
	mysql_query($sql) or die(mysql_error());
	
	}
}
?>
