Problem with array
| From: | Daniel Rezny | Date: | Wed, 23 Aug 2000 14:41:51 +0000 |
| Subject: | Problem with array | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2300@lists.php.net to get a copy of this message | ||
Hello all,
I have a very interesting problem with mysql and php.
I want to make a html <select> tag with dynamicaly generated <option>.
It works but not correct.
This is the code
$exec = mysql_query("select id,bezeichnung from kategorien where
user='".$userid."'");
$count = mysql_num_rows($exec);
echo $count;
$katid=$row[0];
$katname=$row[1];
$i = 1;
for($i=1; $i<=$count; $i++)
{
$line = mysql_fetch_array($exec, $i);
echo ?><option value="<? echo
$line["id"];?>"><?echo
$line["bezeichnung"];?></option><?;
}
So and it is not writes every row from db but every second row. Do
somebody know where is the problem.
Thx for every help.
--
Best regards,
Daniel mailto:dr@photo.digitallaut.at