I have this PHP Code:
for($i=1; $i<=$_POST[\"counter\"]; $i++)
{
if($_POST[\"checkbox$i\"])
{
//select the billing_pdf row
$sql=\"SELE
You have already used $emails_list as a string some where in your page like $emails_list = 7;
and again using it like
$emails_list[] = array(1,2,4);
you fill the array $emails_list[]
in the second while with $contacts2["email"]
.
in the next line, you implode the array to a string.
for the next result (first while loop) $emails_list
is a string. now you can't convert a string to an array
try this:
$emailsListData = array();
while($contacts2=mysql_fetch_array($rs2))
{
//generate the list of emails address in an array
$emailsListData[] = $contacts2["email"];
}
$emails_list = implode(',',$emailsListData);