Hi.
I can't figure out why the following MySQL statement only brings back one row. I've checked this with this line: $i_total = mysql_num_rows($inst_result); and it shows up in a later loop.
$inst_ids = "5,2,3,4";
$inst_sql = " SELECT i_name FROM cm2k_instruments WHERE i_id IN(\"$inst_ids\") ORDER BY i_id";
Am I missing something?
Cheers, Ben
Have you tried your select statement without the quotes around your "IN" string? It would look like this:
SELECT i_name FROM cm2k_instruments WHERE i_id IN($inst_ids) ORDER BY i_id";
Check the documentation about the function mysql_num_rows(), i think there was a problem once with a similar function in obdc, odbc_num_rows() (or something like that), so may be your code is not the problem, check it out just in case.
I guess the i_id column is an integer, so the query goes without the quotes.