Jump to content


Photo

PHP/MySQL mail


  • Please log in to reply
4 replies to this topic

#1 jeliot

jeliot
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 05 April 2006 - 02:13 AM

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...........=)

#2 earl_dc10

earl_dc10
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts

Posted 05 April 2006 - 02:28 AM

I believe you want to change
 $num=mysql_numrows($result);

to
 $num=mysql_num_rows($result);

got a problem? Google helps many of those in need

#3 jeliot

jeliot
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 05 April 2006 - 02:57 AM

[!--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) View Post[/div][div class=\'quotemain\'][!--quotec--]
I believe you want to change
 $num=mysql_numrows($result);

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

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

#4 earl_dc10

earl_dc10
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts

Posted 05 April 2006 - 03:17 AM

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
got a problem? Google helps many of those in need

#5 jeliot

jeliot
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 05 April 2006 - 04:08 AM

[!--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) View Post[/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...........




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users