I have a mysql database named DEALER with tables named by states.
My script displays all the data correctly if I manually inculde the FROM
"state name".I want to make a form to let someone choose the state and run the query. I
have tried and failed can someone show me what I am doing wrong?My searchform:
<html>
<body>
<h1>Find a Dealer Search</h1>
<form action="results.php" method="post">
Choose a State:<br>
<select name="searchtype">
<option value="OHIO">OHIO
<option value="ALABAMA">ALABAMA
</select>
<input type=submit value="Search">
</form>
</body>
</html>
A snip from my results.php
<?php
// connect to my dealer database
$link = mysql_connect("XXX.XXXX.XXX", "XXX", "XXXXXXXX");
mysql_select_db("DEALER");
// query and get the number of records
$query = "SELECT NAME, ADDRESS, CITY, STATE, ZIP, TELEPHONE, WEBSITE,
EMAIL FROM ("results"))"; $result = mysql_query($query) or die("MY QUERY
ERRORS");
$num_record = mysql_num_rows($result);
if($num_record > $display) { // Only show 1,2,3,etc. when there are
more records found that fit on 1 page // when the page is loaded first...
if(empty($pagenr)) {
$pagenr = 1;
}
Would you please help me with my mistakes on line6
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php