|
|
 |
| PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the PHP Databases section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

October 7th, 2004, 10:32 AM
|
|
Authorized User
|
|
Join Date: Dec 2003
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
INSERT syntax error
Can anyone tell me whats wrong with my syntax? I have a php script that I am trying to use to upload data from a csv file into my table. I get this error when I run it:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'dec, catalog_num, constellation ) VALUES ( '23.23964', '-14.991
My SQL statement is:
mysql_query( "INSERT INTO test ( ra, dec, catalog_num, constellation ) VALUES ( '$ra', '$dec', '$catalog_num', '$constellation' )" ) or die( mysql_error());
thanks!
|

October 7th, 2004, 06:30 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Echo the processed query and post it here please.
$query = "INSERT INTO test ( ra, dec, catalog_num, constellation ) VALUES ( '$ra', '$dec', '$catalog_num', '$constellation' )";
echo $query;
Please tell me what it says.
-Snib <><
http://www.snibworks.com
There are only two stupid questions: the one you don't ask, and the one you ask more than once ;)
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |