PHP script to loop a selection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe

    #1

    PHP script to loop a selection

    I¹ve got a bunch of email addresses in a mysql table. I need a php script
    that will loop the results of a selection and format them so I can put them
    in a php mail() function. I¹m not too swift with php ... would this be a
    simple script to code? Any help would be appreciated.

  • D. Pickering

    #2
    Re: PHP script to loop a selection

    PHP script to loop a selection$sql=" select email, name, other from tab";
    $result=mysql_q uery($sql);
    while ($row=mysql_fet ch_object($resu lt) {
    $msg="Dear $row->name at $row->email
    How are you today blah blah
    $row-other";
    mail($row->email,"Junk you didn't want",$msg,"Fro m: yourrealemail@h ostname.com");
    }
    "Joe" <jshockey@vbe.c om> wrote in message news:BBA064CE.1 9C81%jshockey@v be.com...
    I've got a bunch of email addresses in a mysql table. I need a php script that will loop the results of a selection and format them so I can put them in a php mail() function. I'm not too swift with php ... would this be a simple script to code? Any help would be appreciated.

    Comment

    • D. Pickering

      #3
      Re: PHP script to loop a selection

      PHP script to loop a selection$sql=" select email, name, other from tab";
      $result=mysql_q uery($sql);
      while ($row=mysql_fet ch_object($resu lt) {
      $msg="Dear $row->name at $row->email
      How are you today blah blah
      $row-other";
      mail($row->email,"Junk you didn't want",$msg,"Fro m: yourrealemail@h ostname.com");
      }
      "Joe" <jshockey@vbe.c om> wrote in message news:BBA064CE.1 9C81%jshockey@v be.com...
      I've got a bunch of email addresses in a mysql table. I need a php script that will loop the results of a selection and format them so I can put them in a php mail() function. I'm not too swift with php ... would this be a simple script to code? Any help would be appreciated.

      Comment

      Working...