TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-17-2008, 10:30 PM   #1 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default i keep getting unknown error by mysql

anyone see anything wrong in this query?

this is the error im getting:

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 'desc) VALUES( null, 'date', '127.0.0.1', 'k', 'Open', 'Bug', 'Urgent'' at line 1


Code:
$save = mysql_query("INSERT INTO tbl_issues(id,date,ip,domain,status,type,priority,module,title,path,desc) VALUES(

null,
'date', 
'$ip', 
'".$_POST['txt_domain']."',
'".$_POST['drop_status']."',
'".$_POST['drop_type']."',
'".$_POST['drop_priority']."',
'".$_POST['drop_module']."',
'".$_POST['txt_title']."',
'".$_POST['txt_path']."'
'".$_POST['txt_desc']."'") or die(mysql_error());
__________________
no signature set
sarmenhb is offline  
Reply With Quote
Old 02-17-2008, 10:37 PM   #2 (permalink)
The Acquainted
 
Join Date: Nov 2007
Posts: 154
Thanks: 31
SOCK is on a distinguished road
Default

The error message gives you a big clue; desc is a reserved word.
__________________
I reject your reality, and substitute my own.
SOCK is offline  
Reply With Quote
Old 02-17-2008, 11:33 PM   #3 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default

Quote:
Originally Posted by SOCK View Post
The error message gives you a big clue; desc is a reserved word.
lol, thanks i didnt know that.
__________________
no signature set
sarmenhb is offline  
Reply With Quote
Old 02-18-2008, 01:34 AM   #4 (permalink)
The Addict
 
CoryMathews's Avatar
 
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
CoryMathews is on a distinguished road
Default

i did the same thing a while back. no worries.
CoryMathews is offline  
Reply With Quote
Old 02-18-2008, 02:25 PM   #5 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

Another good reason to always use `-quotes on row names ;)
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Old 02-18-2008, 02:28 PM   #6 (permalink)
The Acquainted
 
Join Date: Nov 2007
Posts: 154
Thanks: 31
SOCK is on a distinguished road
Default

Quote:
Originally Posted by Kalle View Post
Another good reason to always use `-quotes on row names ;)
... or another good reason to create thoughtful, non reserved table and column names. I agree with using `backticks` to differentiate column names from data, but it shouldn't be used as a workaround, IMHO. That's the problem with phpMyAdmin, they always use `backticks`, and when users try to use the same column names in their scripts, it always fails.
__________________
I reject your reality, and substitute my own.
SOCK is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 05:02 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design