Jump to content

Archived

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

franklin664

Extracting an email list from mysql database.

Recommended Posts

Hello I have a database that has a table that holds name, email and location and i was wondering how would i exteract all the emails but not the name and locations into a comma seperated list or even better a semi colon seperated list. So i can send a bulk email to them.

 

Thanks

Share this post


Link to post
Share on other sites

Try this

 

<?php 



$sql = mysql_query("select email from table_name"); 

$count = mysql_num_rows($sql);

$c=0;

while ($row = mysql_fetch_array($sql))

{ 

               $b=$row[0];	



                if ( $c < ($count-1))

{

                            $a = $a.$b.\';\';

}

else

{

 $a = $a.$b;

}



$c++;



}



 echo $a;

?> 

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.