I'm trying to do a mass emailing on a monthly basis. I have a field in
the MySQL database that is based on the PHP date function, which
returns everything from year to second. Something like "20050504140334".

Right now, I'm just trying to return all of the email addresses to a
web page, to verify that I'm getting them all. 

I am not getting them all, in fact, I'm only getting one email
address, repeated twice. I presume I'm doing something goofy, bnut I
don't know what it is.

Here's the code:

<?php
require_once("../../php/phpIncludes/connect.php");
mysql_select_db("mydatabase") or die(mysql_error());
$sql = mysql_query('SELECT email FROM myTable WHERE accountNum
LIKE"200504%"') or die(mysql_error());
$fetch = mysql_fetch_array($sql);

foreach ($fetch as $to)
{
echo "$to<br>";
}
?>

Once I get this to work, I'll do the mail() part.

By the way, the same query works fine when I go into PHPMyAdmin.
I'd appreciate any help on this.

Thanks,
Dale




The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to