webdev007
Programmer
- Sep 9, 2005
- 168
Hello,
I could not figure why this works in IE and FF but not in Safari
there is no query error, the DD box feature the query results, this is a small segment of a long script
but not only the submit button is not dislplaid but the rest of the script is stopped (Which could be expected)
However if I comment the <select name=\"city\"> line then the rest of the script is executed
I tried a zillion variances but no luck!
(For test purpose I hard coded the $state value)
<?
echo <<< POST
<form action="by_state.php" method="post">
POST;
$conn=db_connect();
$state="ak";
$query = "
SELECT DISTINCT city
FROM travelospitality
WHERE state = '$state'
ORDER BY 'city' ASC"; //echo"$query";
$result= mysql_query($query);
$num=mysql_num_rows($result);
$i=0;
echo '<select name=\"city\">';
while ($i <$num)
{
echo '<option>';
$city=mysql_result($result,$i,"city");
echo"$city";
$i++;
}
echo <<< SUBMIT
<input type="submit"></form></body></html>
SUBMIT;
?>
I could not figure why this works in IE and FF but not in Safari
there is no query error, the DD box feature the query results, this is a small segment of a long script
but not only the submit button is not dislplaid but the rest of the script is stopped (Which could be expected)
However if I comment the <select name=\"city\"> line then the rest of the script is executed
I tried a zillion variances but no luck!
(For test purpose I hard coded the $state value)
<?
echo <<< POST
<form action="by_state.php" method="post">
POST;
$conn=db_connect();
$state="ak";
$query = "
SELECT DISTINCT city
FROM travelospitality
WHERE state = '$state'
ORDER BY 'city' ASC"; //echo"$query";
$result= mysql_query($query);
$num=mysql_num_rows($result);
$i=0;
echo '<select name=\"city\">';
while ($i <$num)
{
echo '<option>';
$city=mysql_result($result,$i,"city");
echo"$city";
$i++;
}
echo <<< SUBMIT
<input type="submit"></form></body></html>
SUBMIT;
?>