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

$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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.