Order Confirmation

Thank you for your order!

Your Credit Card informations:

Credit Card type: 0

Credit Card number: 2147483647

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\baby\checkout.php on line 16

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\baby\checkout.php on line 16

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\baby\checkout.php on line 17

Warning: Illegal offset type in C:\wamp\www\baby\checkout.php on line 27

include ("header.php");
include ("left.php");
echo "<h3>Order Confirmation</h3>";
$cart = $_SESSION['cart'];
$username = $session->username;
echo "<h4>Thank you for your order!</h4><br /><br /><br />";
echo $cart;


$q1="select timestamp from users where username='$username'";

$items = explode(',',$cart);
		$contents = array();
		foreach ($items as $item)
for ($i=0;$i<=$nri;$i++)
echo "</br><h1>$cart[$items]</h1>";
echo "<h1>OK</h1>";

//$query="Insert into orders(Username,Order_date) values ('$username','$time');";
//$q2="select * from orders order by Order_ID desc";

//$q3="Insert into order_details(Order_ID,PID,Quantity,Price) values('$OID','$item','','')";

include	("tbl_end.php");
include	("footer.php");


Recommended Answers

All 2 Replies

add second and third line shown below at line number 14


$q1="select timestamp from users where username='$username'";

@gonidelux-your code miss the mysql connection string and the database as suggested by urtrivedi on which records are dumped.Include these lines before line 15:-

or die("couldnot connect");
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.