Hi,
Html's textarea's name is "list". More than one subject will be pasted there.
echo "<table>";
$txt = explode("\n", $list);
$count = count($txt);
for ($i=0; $i<$count; $i++) {
$query = "select aaa, bbb from table where aaa = '$txt[$i]';
$result = safe_query ($query, $db);
if (isset($result)) {
while ($row = mysql_fetch_array($result))
{
echo("<tr><td>" .$row["aaa"]. "</td><td>" .$row["bbb"]. "</td></tr>");
}
}
echo "</table>";
So I thought that might be caused by mysql_fetch_array, so I tried to use mysql_fetch_row, same problems.
Only last subject's data was displayed even though my query took all subjects from textarea.
Have any ideas where I am doing wrong?