I need information from 2 tables to insert it into a 3rd. What I have is the following:
if($_POST['report']){
$con = mysql_connect($host, $user, $pass);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_connect($host, $user, $pass) or die("Cannot connect: ".mysql_error());
After this, I have select query 1:
$query = "Select * from something WHERE something='"..$variable.."';";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$variable2 = $row['row1']
$variable3 = $row['row2']
}
Directly after that, we can basically duplicate it but its searching for one of the declared variables in the while statement in another table.
Then it goes and inserts something into a 3rd table. When I add in the 2nd and 3rd SQL statements, I get 500 errors and I don't know whats going wrong.