I have a mysql table with some IDs to results from another table. I can successfully display them using this code:
$info_query = mysql_query("SELECT FROM table1 WHERE (row1 = '$var')");
while ($info = mysql_fetch_array($info_query)) {
$ID = $info['content2'];
$list_query = mysql_query("SELECT FROM table2 WHERE ID = '$ID'");
$list = mysql_fetch_array($list_query);
echo $list['content'];
}
Yet when I try to do a LIMIT on the results, it says it is not valid.
I tried this to limit the results to 15:
$info_query = mysql_query("SELECT FROM table1 WHERE (row1 = '$var') LIMIT 0, 15");
while ($info = mysql_fetch_array($info_query)) {
$ID = $info['content2'];
$list_query = mysql_query("SELECT FROM table2 WHERE ID = '$ID'");
$list = mysql_fetch_array($list_query);
echo $list['content'];
}
This gives an error. Can somebody help???