Ok - I have taken the liberty to write a quick mysql create file.
Copy all the code and save in one file as "setup.php" and remember to delete it after successful set up.
First part of the code is to connect to your mySQL.
<?php
$con = mysql_connect("localhost","user_name","password"); // change "localhost","user_name","password" to match your mysql requirements
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
Now the first thing we need to do is create a database.
// Create database
if (mysql_query("CREATE DATABASE business",$con))
{
echo "business Database has been created<br>Remove files: setup.php from your directory";
}
else
{
echo "Error creating database: " . mysql_error();
}
Now that we created a database titled "business", we need to now create a table to enter our fields.
our table will be called "contact"
// Create table in my_db database
mysql_select_db("business", $con);
$sql ="CREATE TABLE `contact`
Now we have our databse "Business" and we have created a table called "contact" we need to create the fields that will be inserted in the table."
(
`id` int(4) NOT NULL auto_increment,
`b_name` varchar(40) NOT NULL default '',
`b_address` varchar(40) NOT NULL default '',
`b_phone` varchar(20) NOT NULL default '',
`b_city` varchar(20) NOT NULL default '',
`b_state` varchar(15) NOT NULL default '',
`b_zip` varchar(12) NOT NULL default '',
PRIMARY KEY (`id`))";
mysql_query($sql,$con);
mysql_close($con);
?>
Does this help? You can add more fields like: website address, email address, etc.
Now when someone does a search - the query is confined to one table "contact" and can be limited to "city","state"