Sorry about not being clear.
"Post the table definitions (table names and columns), a few rows of example data, and what you would like the output to be for the example data."
Here's what I would like to achieve.
The script I'm interested in writing would allow multiple users, who each have unique identification numbers, access to their customers within my database. In my database, I have a single table (called 'retailers') with a variety of fields (store_id, name, email, repair_number, etc.); the 'store_id' will be used to pull all the records from the database that has that particular number.
For instance, if Manager 1 has 7200 for his 'store_id', then when he types in 7200 in the 'login' page, he can access all 200 of his customers, each identified as 7200 in the database but each with varying information for each field. if Manager 2 has 8200 then he uses 8200 in the login page to access all 50 of his customers, etc.
This is the code I have written that allows for a single customer to access his/her account information:
if(isset($_POST['submit'])) {
$jobnumber=$_POST['jobnumber'];
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("", $con);
$query = "SELECT * FROM customers WHERE job_number='$jobnumber' OR email='$jobnumber'";
$result = mysql_query($query);
My table is called: "retailers"
The fields are: "store_id, name, email, repair_number, in_date, est_date"
Some example rows:
"7200", "George Smith", smith@msn.com, 644305, 3/4/08, 5/6/08;
"7200", "Soxi Young", soxi@msn.com, 684505, 3/4/08, 5/5/08;
"8200", "Mike Thomas", smith@msn.com, 644305, 3/4/08, 5/6/08;
"8200", "Robert Halt", halt@msn.com, 611110, 3/4/08, 5/5/08;
What I want the various managers to be able to see is exactly that. I just can't figure out what the code would be that would allow for 20 or so managers the ability to access their customers by entering their store_id.
Hopefully I did better that time.
Thanks again.