Jump to content

Extracting an email list from mysql database.


franklin664

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

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;

?> 

Archived

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

×
×
  • 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.