Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
this is the sql statment when i dump it

"SELECT id FROM p_msgs WHERE (from_player_id=14 AND to_player_id=15) AND (msg_title=gbhjhghgjhgjgjhgjghj AND msg_body=gbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghj)"



and the error is

Unknown column 'gbhjhghgjhgjgjhgjghj' in 'where clause'
Posted

1 solution

Try:
SQL
"SELECT id FROM p_msgs WHERE (from_player_id=14 AND to_player_id=15) AND (msg_title='gbhjhghgjhgjgjhgjghj' AND msg_body='gbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghjgbhjhghgjhgjgjhgjghj')"

If you don't quote the text, SQL assumes it is a variable name of some form.
 
Share this answer
 
Comments
CHill60 15-Jun-14 12:06pm    
*hands over the 'Hawkeye' moniker* 5'd!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900