Have a problem with a query not inserting properly.
When I have the line
mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO emailerdata (`emailer_timestamp`,`emailer_promoID`,`emailer_name`,`emailer_username`,`emailer_usermd5`,`emailer_email`,`emailer_md5`,`emailer_reactionID`) VALUES ('$date','$promoID','$rec_info[2]','$row[1]','$usermd5','$rec_info[0]','$passmd5','$row[0]')") or die("Error: ". ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)). " with query ". mysqli_query);
on it's own, it inserts fine. However when I try to check to see if the email address in my database has already been inserted with that particular promotion ID in a query, it doesn't insert.
I can't find what's wrong with the query, am sure it's something simple but it isn't showing an error on the or die?
$row_amt = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * from emailerdata where emailer_promoID='$promoID' and emailer_username='$downloadusername'");
while($row4 !== mysqli_fetch_assoc($row_amt)) {
mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO emailerdata (`emailer_timestamp`,`emailer_promoID`,`emailer_name`,`emailer_username`,`emailer_usermd5`,`emailer_email`,`emailer_md5`,`emailer_reactionID`) VALUES ('$date','$promoID','$rec_info[2]','$row[1]','$usermd5','$rec_info[0]','$passmd5','$row[0]')") or die("Error: ". ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)). " with query ". mysqli_query);
}
Many thanks!