|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello anyone who reads this and thankyou for taking the time.
I am trying to create a shopping cart, I have manged to implement user validation, adding stuff to the cart etc. I am now trying to process the customers cart, trying to save the order details to the database, but I keep falling flat on my face. $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); if (!$result1) { echo "hello"; return false; } is the query I'm using. All the variables exist, I have echo'd them. The first value I'm trying to enter is auto incremented in the db, and I'm not sure if that is the correct way to do it (''). Any help would be great. Many thanks, Ernie. P.s. I am a newby to PHP and Mysql. |
|
#2
|
|||
|
|||
|
insteat of using double qoutations use the single qoutations, and then sont use the dots... try this:
PHP Code:
|
|
#3
|
|||
|
|||
|
hi, i think you posted that same question earlier. i guess you didn't look back at it.
|
|
#4
|
|||
|
|||
|
Thanks for the help but still the same prob
Thanks for all the help, but removing the " and the . didn't help still got the same prob. It doesn't run the query, it just returns false and the function says could not store data. I know exactly where it is failing but I have no idea why. Most Confused.
In another function I use to input the users details into the DB, I had to use " and . for the query to run. To be honest I'm not really sure how I got this far. All I've got is a pony book on PHP and mysql that doesn't explain much and help from people like you on the net. |
|
#5
|
|||
|
|||
|
Please ignore my stupidity.
I'm so sorry for having troubled yoy with my prob, it was a sytax error even though it wasn't being reported. If you look very closely you will see that I have put a . instead of a , when I pass the query to the DB.
Once again thanks for the help, and cap in hand time. Ernie ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Problem with quotes on SQL insertion |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|