Jump to content

PHP/MySQL mail


jeliot
 Share

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...........=)
Link to comment
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
Link to comment
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...........
Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

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.