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

Recommended Answers

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

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

And it should work.

Jump to Post

All 2 Replies

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

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

And it should work.

Hi

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

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.