0

Hi im using FIND iN SET in a query like below, but i get an error stating that im using wrong syntax and also Warning: mysql_fetch_array() expects parameter 1 to be resource

$result = mysql_query("SELECT * FROM table FIND_IN_SET($txt2, field)") or trigger_error(mysql_error().$sql);

Hope someone can help with this, thanks

2
Contributors
2
Replies
16
Views
4 Years
Discussion Span
Last Post by mpc123
0

$txt2 is considered a string, so you have to use quotes:

"SELECT * FROM table FIND_IN_SET('$txt2', field)"

And it should work.

0

Hi

Thanks for the reply, I have used quotes but there is no results coming back when manually I check there should be

Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.