I'm trying to query all results where surveyid contains my array $subscibearray. The problem is the SQL query is only returning the first result (44 in this case) instead of all of them. I tried using mysql_fetch_array as well without any success. My results are being outputted via Table. Any help would be appreciated. I omitted as much code as possible to make this easy to read.
$subscribearray = "" . join(', ',$subscribearray) . "";
string(17) "'44, 35, 194, 36'"
$result = mysql_query("SELECT *
WHERE surveyid IN ($subscribearray)
ORDER BY peercompletetime DESC
$subscribearray = join(',', $subscribearray); // 1,2,3
$subscribearray = "'" . join("','", $subscribearray) . "'"; // '1','2','3'
If you wrap all ids with a string, it will look for the string, and not separated values. ('1,2,3')
Of course, if it's a numeric column you should use the first one.