• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need some mysql query help.

Syran

Golden Member
I have a script, which i've used successfully in the past, that is giving me an error this time out. It allows you to search multiple categories for what you are looking for. In the case of this code, it works for 4 of the 5 seaches. Here's is the basic db design:

id int(11)
at int(11)
vendor varchar(60)
actpn varchar(10)
part varchar(30)
desc varchar(200)

Here is the error message i'm getting:
You have an error in your SQL syntax near 'desc LIKE '%blah%' ORDER BY id' at line 3
Couldn't execute query: SELECT * FROM atminv_item WHERE desc LIKE '%blah%' ORDER BY id

And finally, the entire code script:
 
I have 5 items you can search: at, actpn, part, vendor, and desc. All have tested and worked EXCEPT for desc. I'm not sure why, since I have other varchar items in it, and i've never had any issues with this search code before now.
 
I would try renaming the column to something other than "desc"- which is a keyword in most databases....

 
Originally posted by: lozina
I would try renaming the column to something other than "desc"- which is a keyword in most databases....

:thumbsup:

This would be my suggestion as well.
 
Back
Top