1

I am troubles with this method not returning results. There are ids within 'table' that match the array. I guess it's not liking something, except I cannot quite put my finger on it.

$define = ",8,9,10,";

// ** Data Retrieve ** // 
mysql_select_db($database_db, $db);
$query_data = "SELECT * FROM table WHERE FIND_IN_SET('".$define."', id)";
$data = mysql_query($query_data, $db) or die(mysql_error());
$row_data = mysql_fetch_assoc($data);
$totalRows_data = mysql_num_rows($data);
Brandrally
  • 803
  • 3
  • 14
  • 24

1 Answers1

0

In FIND_IN_SET the target value is first, and the list second. So, the query should be as follows:

SELECT * FROM table WHERE FIND_IN_SET(id,'".$define."');
Tarun Parswani
  • 4,565
  • 3
  • 13
  • 13