PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old March 31st, 2004, 08:34 AM
Erniefrontier Erniefrontier is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 12 Erniefrontier User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question PHP syntax

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

Last edited by Erniefrontier : March 31st, 2004 at 08:35 AM. Reason: UPdate

Reply With Quote
  #2  
Old March 31st, 2004, 10:42 AM
crudesys crudesys is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: California
Posts: 25 crudesys User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP syntax


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway