I have 1 big form that will receive information from 2 different tables (table1 and table2) in the same database.
All info will be placed in the same form where you can save it all to a new table.
My issue is when some of the row in both table (table1 and table2) have the same name how do I call the info from the correct table. So fare I have:
The URL that will call the info looks like:
….info.php?id=320&folder=ras
The query:
if(!$_POST["submit"])
{
//INFO FORM TABLE 1
$query = mysql_query("select country, state, name, dob from table1 where id = '".$_GET["id"]."' ");
$row = mysql_fetch_row($query);
$country = $row[0];
$state = $row[1];
$name = $row[2];
$dob = $row[3];
//INFO FORM TABLE 2
$query = mysql_query("select country, state, name, dob from table2 where folder = '".$_GET["folder"]."' ");
$row = mysql_fetch_row($query);
$country = $row[0];
$state = $row[1];
$name = $row[2];
$dob = $row[3];
The vaiable on the website:
From table 1: //1 <?=$country?> //2 <?=$state?> //3 <?=$name?> //4 <?=$dob?>
From table 2: //1 <?=$country?> //2 <?=$state?> //3 <?=$name?> //4 <?=$dob?>
Im not sure how to do this, but I think that I need to change one of the query to something like:
$query2 = mysql_query("select country, state, name, dob from table2 where folder = '".$_GET["folder"]."' ");
$row = mysql_fetch_row($query2);
$country = $row[0];
$state = $row[1];
$name = $row[2];
$dob = $row[3];
But if I do that what variable should I use to call the info in table2?
<?=$2”country”?>
don’t work.
Please advice.