guymclaren Posted September 21, 2008 Share Posted September 21, 2008 $mail = " SELECT id FROM invite WHERE sentcode = '1' ORDER BY id ASC"; $rec = mysql_query($mail) or die(mysql_error()); $row = mysql_fetch_assoc($rec); while ($row != Null){ $email = $row['email']; $fname = $row['fname']; //send email// } Quote Link to comment Share on other sites More sharing options...
Minase Posted September 21, 2008 Share Posted September 21, 2008 thats totaly wrong instead of while you need IF but if i understood corectly you want to loop through all records from DB ? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted September 21, 2008 Share Posted September 21, 2008 Why don't you try it for yourself. It's not going to blow up, so you may as well give it a shot. But, as Minase said, you may want this: $mail = " SELECT id FROM invite WHERE sentcode = '1' ORDER BY id ASC"; $rec = mysql_query($mail) or die(mysql_error()); while ($row = mysql_fetch_assoc($rec)){ $email = $row['email']; $fname = $row['fname']; //send email// } Quote Link to comment Share on other sites More sharing options...
guymclaren Posted September 21, 2008 Author Share Posted September 21, 2008 I figured I would get guidance because ASP works so differently, I am actually rewriting something I did a while ago in ASP but for reasons of insanity now require in PHP. Thanks for the help Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 21, 2008 Share Posted September 21, 2008 The best way to learn something is to try it and see what the results are. If the result are what you expect, than your understanding is correct. If not, then you need to try again. Quote Link to comment Share on other sites More sharing options...
guymclaren Posted September 21, 2008 Author Share Posted September 21, 2008 NSS, I do that, occassionally when I am unsure I will ask a stupid question and get an even less satisfactory answer. Thank you to those that helped. 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.