Hi,
I'm trying to use this script as well, but I always get the following error message:
Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING' in C:\apache\htdocs\dropdowntest.php on line 34
where line 34 is the following line: echo "<option value=" . $arr['id'] . "/>$arr['id']";
This is the form part of the script:
<form method="POST" action="dropdowntest.php">
<!--webbot bot="SaveResults" u-file="fpweb:///_private/form_results.csv" s-format="TEXT/CSV" s-label-fields="TRUE" --><p>
<select size="1" name="D1"></select></p>
<?php
mysql_connect("localhost","user","passw");
mysql_select_db("testdb");
$query="SELECT * FROM testtable";
$r=mysql_query($query);
if($r && mysql_num_rows($r)>0)
{
echo "<select name='id'>\n";
for($i=0;$i<mysql_num_rows($r);$i++)
{
$arr=mysql_fetch_array($r);
echo "<option value=" . $arr['id'] . "/>$arr['id']";
}
echo "</select>";
}else
echo "ut-oh";
?>
<p> </p><p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</select></form>
I hope somebody can help me! Thanks
Dynamic2000 😕