Hi,
Hi,
I had loop problem. I tried one day to figure out where it is problem, just simply not work. $count and $query does take all input list, but $row seemed only take last input no matter how many input it was. My main partial code like
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?