here is the code
Code: Select all
<?php
print_r($_POST);
if(isset($_POST['submit']))
$host = "localhost";
$username = "localhost";
$password = "abc123";
$database = "contacts";
if(isset($_POST['Categories']))
{
$Categories = trim(addslashes($_POST['Categories']));
}
else
{
echo 'No Category Passed';
exit;
}
$db = mysql_connect($host, $username, $password);
mysql_select_db($database);
$query = "SELECT * FROM Categories WHERE Categories LIKE '%$Categories%'";
$result = mysql_query($query) or die (mysql_error());
$num_result = mysql_num_rows($result);
if($num_result == 0)
{
echo("No Results found.");
exit;
}
echo "<p>Number of business found: $num_result </p>";
while($row = mysql_fetch_assoc($result))
{
echo '<p><strong>Business Name (' . stripslashes($row['BusinessName']) . ')';
echo '(' . $row['slogan'] . ')</strong><br />';
echo 'Address (' . stripslashes($row['BusinessAddress']) . ')<br />';
echo 'State (' . stripslashes($row['make']) . ')<br />';
echo 'City (' . stripslashes($row['type']) . ')<br />';
echo 'Tel (' . stripslashes($row['tel']) . ')<br /></p>';
}
?>Array ( [make] => Massachusetts [type] => Lawrence [Categories] => printing [textfield] => [submit] => Search )
Number of business found: 1
BusinessName ()()
Address ()
State ()
City ()
Tel ()
i have a business name MASS AD
Address 19 Central St
In MAKE MASSACHUSETTS
TYPE LAWRENCE
978.327.5139
how can i make like that for now it is just showing that i have a category Name "Printing"