
March 31st, 2004, 10:42 AM
|
|
Registered User
|
|
Join Date: Mar 2004
Location: California
Posts: 25
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by Erniefrontier Could some please tell me the correct syntax for entering data into a mysql db using a PHP script. I want to enter a customer order with the first attribute is an auto increment number created in the db as a primary key (order id) and then details about the order and then order status with the value PARTIAL. I am slightly confused about the PARTIAL value, so any enlightenment would be great.
This is the code I'm using:
$query_insert_order = "insert into orders values ('', '".$userid."', '".$total_price."', '".$date."' ,'PARTIAL', '".$ship_name."', '".$ship_address."', '".$ship_city."', '".$ship_state."', '".$ship_zip."', '".$ship_country."')";
$result1 = mysql_query($query_insert_order. $connection);
Many Thanks
ERnie |
hi. try taking out the double quotes(") and dots (.) and use single quotes. see sample below:
$query_insert_order = "insert into orders values ('$userid','$total_price','$date' ,'PARTIAL', ...)";
$result1 = mysql_query($query_insert_order. $connection);
hope this works for you. good luck
|