phppup Posted May 19, 2018 Author Share Posted May 19, 2018 Follow up question: what would be the best way of sending a final email with a message that would list all IDs that were contacted (in the loop of emails)? Is there a way to retain and call those IDs? Or do I need a 2nd while statement to re-capture that info again? Quote Link to comment Share on other sites More sharing options...
Barand Posted May 20, 2018 Share Posted May 20, 2018 Store the sent ids in an array as you are looping through the data in your current while() loop. You could replace ++$count; with $sent_ids[] = $row['id']; since a count() of the array elements will tell you how many. Quote Link to comment Share on other sites More sharing options...
phppup Posted May 20, 2018 Author Share Posted May 20, 2018 Stayed up late again and figured it out. THANKS AGAIN. Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted May 21, 2018 Share Posted May 21, 2018 (edited) NM - just saw the 2nd page of responses. Your original code is really really wrong. It's looping through the database results and trying to send an email each time. Then when you're done with your loop you set the headers and message that you used inside your loop to send the e-mails. Try this. You'll have to put your actual table name in instead of x. But if you don't get anything from that. Then the problem is the query or $link $query = "select * FROM x where id > ='210'"; $result = mysqli_query($link, $query); if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { var_dump($row); } } Even my limited knowledge has allowed me to have confidence in the db and table that I am using.I have a separate script with the same or similar connections to the same table and it successfully echoes all variables in a table.My sense is that there is a disorder in the format of my email or a misplaced } .Either way it appears that the code is allowing a break in the loop (which actually seems NOT to be looping, but rather only running once(at best).Sadly, my original code still comes closest to a successful outcome (since it at least Manfred to send one email. LoL Edited May 21, 2018 by taquitosensei Quote Link to comment 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.