SQL issue NEARby

Status
Not open for further replies.

HairyHun

Masturbating Bandit
Oct 11, 2007
576
2
0
I'm having a very resilient bug.

Here is the code.

PHP:
$query = "SELECT ID, FirstName, State, Zip, Email, Home1, Home2, Citizenship, Employment, AreaEduc, AreaHousing, AreaCC, DebtAmount, PaymentStatus, Usage, Year, Month, Day, Hour, Minute, Source, Keyword, Deleted FROM v2 WHERE Year = \"". $Year . "\" AND Month  = \"". $Month . "\" AND Day = \"". $Day . "\"  AND Deleted = 0 ORDER BY Month DESC, Day DESC;";

This is the code I used to save lead info into a DB. It has always worked, I usually just recopy the line for new files and change the attribute names.

But this time I keep getting the following error:

Error : 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 'Usage FROM v2 WHERE Year = "2008" AND Month = "08" AND Day = "04" AND Deleted =' at line 1

I recopied a working version and changed the attributes again, still the same error.

I been staring at this for an hour. Maybe someone here can have a new insight for me.

Thanks
HH
 


It turns out. That if you have a attribute called "Usage" then you can write to it, but when you try to read it, it gives you a syntax error.

This is the best conclusion I found.

HH
 
I just changed the name Usage to Goal. And it works since. But I had no idea Usage was a forbidden or restricted term.
 
Status
Not open for further replies.