p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > PHP/MySQL > PHP Databases
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 7th, 2004, 10:32 AM
Authorized User
Points: 90, Level: 1
Points: 90, Level: 1 Points: 90, Level: 1 Points: 90, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 7th, 2004, 06:30 PM
Friend of Wrox
Points: 2,801, Level: 22
Points: 2,801, Level: 22 Points: 2,801, Level: 22 Points: 2,801, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 ;)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error when using "Insert Into" Luis Access VBA 14 November 18th, 2008 03:09 PM
Syntax Error on Insert dalezjc Classic ASP Basics 29 June 20th, 2007 07:50 PM
Syntax error INSERT INTO ITladybug ADO.NET 2 January 31st, 2006 07:50 AM
Syntax error in INSERT INTO statement. kingleon Classic ASP Basics 1 May 10th, 2005 07:25 PM
Syntax error in INSERT INTO statement Stephan BOOK: Beginning JavaScript 16 February 22nd, 2005 01:43 PM



All times are GMT -4. The time now is 07:10 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc