When I have more than one mysql_query() in a single script. The last one won't execute. I don't get an error. It just doesn't work. It doesn't matter whether I have 2,3,4, etc.. the last one in the line won't execute.
Here's an exaple of the code.
It loops through two arrays to create the SQL statement and then executes. THe db connection is global.
I've spent days trying to figure this out. Please help.
Thanks,
mf
<?php
//##############################################################################
// if it passes all the tests then we insert the info into Customer and Practice Tables
// Also a joined table between the Customer and Practice
// then an email is sent out, the customer is not made live until the user logs in for the first time.
//##############################################################################
//Inserts the data
//Creates an Customer and Practice ID
$CustomerID = md5(uniqid(rand()));
$PracticeID = md5(uniqid(rand()));
$Date = date("Y-j-m H:i:s");
//Runs through the insertProfile Array in order to create the SQL INSERT Statement
$queryPractice = "Insert into PracticeProfile Set ";
$queryPractice .= "CustomerID = '$CustomerID ', ";
$queryPractice .= "PracticeID = '$PracticeID ', ";
while ( list($key, $value) = each($InsertPractice))
{
$queryPractice .= "$key = '$value', ";
}
$queryPractice .= "DateAdded = '$Date'";
$resultPractice = mysql_query($queryPractice);
//Runs through the insertClient Array in order to create the SQL INSERT Statement
$queryClient = "Insert into CustomerAccounts Set ";
$queryClient .= "CustomerID = '$CustomerID ', ";
$queryClient .= "Live = 'N', ";
while ( list($key, $value) = each($InsertClient))
{
$queryClient .= "$key = '$value', ";
}
$queryClient .= "DateAdded = '$Date'";
$resultClient = mysql_query($queryClient);
//sends email to the user with confirmation
$Subject = "Welcome to Eorthopod.";
$Body = "This is a test.";
$Recipient = $InsertClient[CEmail];
$Sender = "mfitzgerald@montana.com";
//Sends a confirmation mail to the customer with the password
mail($Recipient, $Subject, $Body, $Sender);
//redirects to the Confirmation page
Header("Location: Confirmation.php?queryClient=$queryClient&queryPractice=$queryPractice");
?>