Hi!
Pardon me if this is stupid.. 😉
I have a table which keeps data on the company name and city location, and another which keeps data on employee, the company they work for(RelCompID) and phone number. On a script I select the company from a drop down menu and add the rest of the information via text boxes. When I go to the next page to display the data I just entered, I successfully echo the Name, Company ID, and phone, but instead of seeing the Company ID, I want to see the company name. I am not sure where I am going wrong. Any advice?
SQL table structure:
Comp_ID | Company Name | City
ID | RelCompID | Name | Phone
Code:
$sqlquery = "INSERT INTO part_name VALUES('','". $_POST['name'] ."','". $_POST['RelCompID'] ."','". $_POST['phone_num'] ."','". $_POST['email_addr'] ."')";
$queryresult = mysql_query($sqlquery) or die(" Could not execute mysql query !");
$sqlquery = "SELECT * from part_name";
$sqlquery1 = "SELECT * from part_company WHERE RelCompID = '$cpny_id'";
the variable from the company table I am trying to echo is 'cpny_name'. Tried to echo it here:
<tr>
<td> Name<</td>
<td>'.$_POST['name'].'</td>
</tr>
<tr>
<td>Company/Firm</td>
<td>'.$_POST['cpny_name'].'</td>
</tr>
Help!