Jump to content

Archived

This topic is now archived and is closed to further replies.

jeliot

PHP/MySQL mail

Recommended Posts

I've been all over the Manual and was able to get bits and pieces of what I need to collect just the email field from my db and send email but its just not FLYIN...............

Here's what i've got

<?
$link = mysql_connect("host", "user", "password");
mysql_select_db("test");

$query = "SELECT * FROM test_list";
$result = mysql_query($query);
$num=mysql_numrows($result);
mysql_close($link);

$i=0;
while ($i < $num) {

$email=mysql_result($result,$i,"email")
$subject = "Ggap Show Reminder";
$body = "This is a test email for Ggap New Show Reminders";
$headers = "From: user@mydomain.com";

mail($email,$subject,$body,$headers);

$i++;
}
?>

Please Help.......I'M CROSSED EYED...........=)

Share this post


Link to post
Share on other sites
I believe you want to change
[code]
$num=mysql_numrows($result);
[/code]

to
[code]
$num=mysql_num_rows($result);
[/code]

Share this post


Link to post
Share on other sites
[!--quoteo(post=361807:date=Apr 4 2006, 10:28 PM:name=earl_dc10)--][div class=\'quotetop\']QUOTE(earl_dc10 @ Apr 4 2006, 10:28 PM) [snapback]361807[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I believe you want to change
[code]
$num=mysql_numrows($result);
[/code]

to
[code]
$num=mysql_num_rows($result);
[/code]
[/quote]

Thanks but still a no go........I'm a little confused on where I'm actually getting just my email....field/Colum

Share this post


Link to post
Share on other sites
sorry, I forgot that mysql_numrows is just an earlier version, but probly a good idea to change it anyway. do you receive any errors or does it just not run. oh, maybe a ";" after defining $email will do it

Share this post


Link to post
Share on other sites
[!--quoteo(post=361818:date=Apr 4 2006, 11:17 PM:name=earl_dc10)--][div class=\'quotetop\']QUOTE(earl_dc10 @ Apr 4 2006, 11:17 PM) [snapback]361818[/snapback][/div][div class=\'quotemain\'][!--quotec--]
sorry, I forgot that mysql_numrows is just an earlier version, but probly a good idea to change it anyway. do you receive any errors or does it just not run. oh, maybe a ";" after defining $email will do it
[/quote]

Yah the ; was a typo from my last edit.........still nothing......id did have the script running but it was using every
field and data in each field as a email address so i think my only poblem is getting to just pull the email field

and no i'm not getting any errors
i'm still chuggin...........

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.