Hi I have create a database and i wish to read and display the contents base on a specific field can i do the following?
PHP Code:<?
include("dbase.php");
$numresults = mysql_query("SELECT * FROM mytable WHERE
city LIKE '%{$search}%' AND
state LIKE '%{$search1}%'");
while ($data=mysql_fetch_array( $numresults )) {
if ($data['city'] == 'search' and $data['state']=='state');
echo $data['name']."<br />".$data['address']."<br/>".$data['city']."<br />"."<br />";
} else {
echo "no data found";
}
?>



Reply With Quote
Bookmarks