Drummin Posted May 16, 2011 Share Posted May 16, 2011 Can anyone spot where my error is or why I might be getting multiple emails sent? $getNEWid2 = mysql_query("SELECT ID FROM ".$conf['tbl']['users']." ORDER BY ID DESC LIMIT 1 "); WHILE ($NEWid2 = mysql_fetch_array($getNEWid2)){ $send = mysql_query("SELECT name,user,email from ".$conf['tbl']['users']." WHERE ID=$NEWid2[iD]"); WHILE($newsiteuser = mysql_fetch_array($send)) { //emails sent here// }} Quote Link to comment https://forums.phpfreaks.com/topic/236584-multiple-emails-being-sent/ Share on other sites More sharing options...
fugix Posted May 16, 2011 Share Posted May 16, 2011 you could try debugging your queries... $getNEWid2 = mysql_query("SELECT ID FROM ".$conf['tbl']['users']." ORDER BY ID DESC LIMIT 1 ") or die(mysql_error()); WHILE ($NEWid2 = mysql_fetch_array($getNEWid2)){ $send = mysql_query("SELECT name,user,email from ".$conf['tbl']['users']." WHERE ID=$NEWid2[iD]") or die(mysql_error()); WHILE($newsiteuser = mysql_fetch_array($send)) { //emails sent here// }} Quote Link to comment https://forums.phpfreaks.com/topic/236584-multiple-emails-being-sent/#findComment-1216268 Share on other sites More sharing options...
Drummin Posted May 16, 2011 Author Share Posted May 16, 2011 Thanks Fugix for the reply. I found the error higher in the code causing the POST to be run more than once. Quote Link to comment https://forums.phpfreaks.com/topic/236584-multiple-emails-being-sent/#findComment-1216274 Share on other sites More sharing options...
fugix Posted May 16, 2011 Share Posted May 16, 2011 okay glad you figured it out Quote Link to comment https://forums.phpfreaks.com/topic/236584-multiple-emails-being-sent/#findComment-1216276 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.