Some1 wrote some code earlier today, and i tried the code myself, but somehow i have done something wrong. At the line where while starts i get an error. The code is for getting rows from 1 field out of a table from a mysql database
I am newbie, so i probaly am just forgetting something stupid. I would be realy happy of some1 could help me by taking a small peek on the code,
the code:
<?php printf("<form method=post action=test.php");
$usr = "root";
$pwd = "";
$db = "knowledgebase";
$host = "localhost";
mysql_connect($host,$usr,$pwd);
$sql_result = mysql_query("SELECT xrd FROM category");
while ($myrow = mysql_fetch_array($sql_result)) {
$category = $myrow["category"];
$option_block .= "<OPTION value=\"$category\">$category</OPTION>";
;
}
?>
<?
echo "Submitted value:".$category;
?>
<b><font face=Verdana, Arial, Helvetica, sans-serif size=3>Category:</b></font>
<form name="testForm" action="test.php">
<SELECT name="Category">
<?php echo "$option_block"; ?>
</SELECT><BR>
<input type="submit" value="Send">
</form>
with kind regards,
Shadeless