This appears above my page
You are using single quotes around column names:
$insertQuery=mysql_query("insert into 'order'('cust_id', 'order_date', 'order_total',
'order_state', 'order_city', 'order_add', 'order_post')values('$cust_id','$order_date',
'$order_total', '$order_state', '$order_city','$order_add','$order_post')")
Try this instead:
$insertQuery=mysql_query("insert into `order` (`cust_id`, `order_date`, `order_total`,
`order_state`, `order_city`, `order_add`, `order_post`)values('$cust_id','$order_date',
'$order_total', '$order_state', '$order_city','$order_add','$order_post')")
Or you can remove them completely if you are sure they aren't reserved words and they don't have spaces or other such silly things in them:
$insertQuery=mysql_query("insert into `order`
(cust_id, order_date, order_total, order_state, order_city, order_add,
order_post)
values('$cust_id','$order_date',
'$order_total', '$order_state', '$order_city','$order_add','$order_post')")
Lastly, this assumes that you do indeed have all the variables set correctly at the time you try to run the query. If you try to insert a value that is empty, the SQL will end up like insert into someTable values ('someValue','')
which will generate an error as well.
Edit: To echo out the data do this:
echo ("insert into `order`
(cust_id, order_date, order_total, order_state, order_city, order_add,
order_post)
values('$cust_id','$order_date',
'$order_total', '$order_state', '$order_city','$order_add','$order_post')");
And then edit your question and add the output you see. This will probably solve the riddle for us.
Use this code
<?php
include("dbconnection.php");
if ($_SESSION["loggedin"] != "true") {
header("Location:memberlogin.php");
}
$cust_id = $_SESSION["cust_id"];
$result = mysql_query("select customer.*, product.*, order_details.* from customer, product,
order_details where customer.cust_id=$cust_id and product.pro_id=product.pro_id and
order_details.order_details_id = order_details.order_details_id")or die(mysql_error());
$row = mysql_fetch_assoc($result);
?>
And use this guide >> http://www.w3schools.com/php/php_syntax.asp