Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mySQL keyword in query, how to handle?

Status
Not open for further replies.

dwessell

Programmer
Jan 26, 2006
114
US
Hey all.. I have a query that goes something like this:



"UPDATE ItemInformation SET ItemUsed = 1, LastItem = 1 WHERE GameNumber = `$row[0]` AND
TeamNumber = $innerRow[2] and Item = $itemResult[0]";


$itemResult[0] might possibilty contain a SQL keyword, like from.. How can I handle this?

Thanks
David
 
If it's a MySQL keword, it'll be a string. And strings in a query should be inside singlequotes. That's what the singlequotes are for -- so that MySQL can differentiate between things that are meaningless (for MySQL) strings and meaningful keywords.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top