I have transfered variable values to another page, but now I'm trying to show the database content relevant to this value.
Workflow:
- There's a form that I enter a new Company. I have entered Company1. It's in companies database.
- There's another form, that I list in an OPTION tag all the recorded companies. In this form, I record the company's employees information, including the chosen companies option.
- There's a page that lists all the recorded companies. Each one has a link (company.php?name=$companyName).
- The companies' names are passed via GET to another page.
- This other page is called "company.php" and need to show the company's information (other fields in database).
- It also has to show other table record, like "employees". It must list all the employees that has de same company's name, passed via GET.
The question is: how do I proceed with step 5 and 6? I tried using this select, but didn't work:
$query = mysql_query("SELECT employeeName FROM employeeForm WHERE companyName='$employeeName'") or die(mysql_error());
It's really difficult for me to be clear at this, I'm sorry if it's not understandable. 'Been working around this issue for hours.
I appreciate any help!
EDIT: Used method:
include("connect.php");
$companyName=$_GET['companyName'];
$result = mysql_query("SELECT * FROM employeeList WHERE company = '$companyName'");
while($result = mysql_fetch_array($query))
{
echo '<div class="form">'.$result['employeeName'].'</div>';
}

companyName = 'Fred Smith'in your database? shouldn't it be more likecompanyName = 'Acme Inc.'companyName = '$employeeName'why notcompanyName = '$comopanyName'?