2 dimension array and listbox
Posted: Wed Dec 21, 2005 11:21 am
Jcart | Please use
Please help me.. 
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
My broblem is that i need 2 select 2 values from the table(Id, Category). How 2 put these 2 dimension array and then show these in the listbox. Here's what i made and it aint workin'. No error messages, but i know somethin' is wrong. I've tried 2 long...Code: Select all
$sql_lauseke = ("select Id, Category from Categoria");
if (!$sql_lauseke = mysql_query($sql_lauseke, $yhteys))
{
echo "Haku epaonnistui";
echo mysql_error();
exit;
}
else
{
$row = array(Id, Category);
}
echo "<form action='index.php?id=' method='post'>";
echo "<table width='400' border='0'>";
echo "<tr><td>Kategoria:</td>
<td><select size=''name='kategoria'>"; for($i=0;$i<count($row);$i++){
echo "<option value='".$row[$i][0]."'>".$row[$i][1];}"</option> ";
echo "</select>"; "<td> </tr>";Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]