Jump to content

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;

?> 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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