one row?
| From: | Data Driven Design | Date: | Thu, 20 Jul 2000 18:45:50 +0000 |
| Subject: | one row? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-7463@lists.php.net to get a copy of this message | ||
This is some code I've been testing and for some reason the middle section
only puts one row into the select box. What am I missing?
if (isset($searchState)) {
if (isset($searchCity)) {
$query .= " WHERE City = '$searchCity' AND State = '$searchState'";
$display=true;
} else {
$state_query = "SELECT DISTINCT City FROM florists WHERE State =
'$searchState' ORDER BY City";
$state_result = @mysql_query($state_query);
if (mysql_num_rows($state_result)) {
print "<form action=\"$PHP_SELF\" method=\"post\">\n";
print "<input type=\"hidden\" name=\"searchState\"
value=\"$searchState\">\n";
print "<select name=\"searchCity\">\n";
while ($row = mysql_fetch_row($state_result)) {
print "<option>$row[0]</option\n";
}
print "</select>\n";
print "<input type=\"submit\" name=\"action\"
value=\"Search\">\n";
print "</form>\n";
} else print "No Florists Found<p><a
href=\"$PHP_SELF\">Search</a>
Again?\n";
}
}
After this block and several others that search by zip code, area code and
company name is the section that builds and executes the query.
Data Driven Design
P.O. Box 1084
Holly Hill, FL 32125-1084
Phone : (904) - 226-8979
URL : http://www.datadrivendesign.com
URL : http://www.rossidesigns.net