0

Order Confirmation

Thank you for your order!


84,46,62,84
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

<?php
include("include/session.php");
include("funksione.php");
include ("header.php");
include ("left.php");
include("tbl_begin.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;

show_user_info($username);

$q1="select timestamp from users where username='$username'";
$r1=mysql_query($q1);
$row=mysql_fetch_array($r1);
$time="".$row['timestamp']."";

$nri=count($cart);
$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>";
$items++;

}
}
//$query="Insert into orders(Username,Order_date) values ('$username','$time');";
//$q2="select * from orders order by Order_ID desc";
//$r2=mysql_query($q2);
//$row2=mysql_fetch_array($r2);
//$OID=$row2['Order_ID'];

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


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

?>
3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by IIM
0

add second and third line shown below at line number 14

show_user_info($username);
$conn=mysql_connect("localhost","username","password");
mysql_select_db("dbname",$conn);

$q1="select timestamp from users where username='$username'";
$r1=mysql_query($q1);
1

@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:-

$conn=mysql_connect("localhost","root","")
or die("couldnot connect");
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.