How to resolve "You have an error in your SQL syntax; check the manual..."?
I am new to all of this stuff and Please help me to resolve this.
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 'out) as tout from hl_traffic where listing_id = 1 and date + interval 7 day > no' at line 1
First of all, I don't know what that mean.
My host provide :PHP version 4.4.6, MySQL version 5.0.27-standard
Here is the table I created.
id bigint(20) UNSIGNED No auto_increment
date date Yes NULL
listing_id bigint(20) UNSIGNED No 0
in bigint(20) UNSIGNED No 0
out bigint(20) UNSIGNED No 0
If you need more info about the problem, I will provide it for you.
If you know the problem, can you teach me step by step?
if (!$result) // meaning that there was an error in the SQl statement...
{
echo ("SQL: " . $sql . "\n";
echo ("mysql_error() . ": " . mysql_errno() . "\n");
die;
}
that way, it echoes the SQl statement so i can paste it into my fav mysql client and further view it.
plus, it dumps the mysql error # and message.
Must read Review for Serious PHP Developers
NuSphere PhpED 5.5
: The Staff of php-editors.com recently spent a few days working with NuSphere
PhpED 5.5
(a popular PHP IDE) and
NuCoder 2.0
(a PHP Encoding Utility), read up on all the details.