if i just have while then it just repeats and repeats none stop.
If i change it to forloop what do i put in the brackets because theres no "as" command in while?
Splitting data in text box - send emails to each individualy
Moderator: General Moderators
-
cvmflinchy
- Forum Newbie
- Posts: 13
- Joined: Sat Feb 06, 2010 12:58 pm
Re: Splitting data in text box - send emails to each individualy
I'm confused by your database code
This is how I would do it using mysqliCode: Select all
$rs = $oAppl->query($q); while($rw = $oAppl->row($rs)){
Code: Select all
$oAppl = new mysqli('localhost','username','password','database');
$q = "SELECT DISTINCT email FROM orders";
$rs = $oAppl->query($q);
while($rw=$rs->fetch_row();){
$to1=$rw['email'];
//send email stuff
}
-
cvmflinchy
- Forum Newbie
- Posts: 13
- Joined: Sat Feb 06, 2010 12:58 pm
Re: Splitting data in text box - send emails to each individualy
its because the same database is called for a lot of things from several pages so its in all that code you posted is in a require db.php in the pages.
The code works. but when i run it with only while($rw... it seems to repeat none stop when i have the code for while and foreach it only loops round twice. i just need to get it to do it once.
The code works. but when i run it with only while($rw... it seems to repeat none stop when i have the code for while and foreach it only loops round twice. i just need to get it to do it once.