I've been reading in every thread in here that is related to this but I always get it wrong.
Please help cause I always get the error
"Notice: Array to string conversion" in line "$address[] = mysql_result($row, 0 );"
below. Please help.
if ($p_address=mysql_query($email))
{
$address = array();
while($row = mysql_fetch_assoc($p_address))
{
$address[] = mysql_result($row, 0 );
}
$all_address = implode(',', $address);
$row is set in every iteration of the while loop. every time it contains a new table record. So you just need to add each record in the address array.
Change this line
To this:
And then to see the keys and values available in the new
$address
array, you can do something like this:In order to keep
implode()
functional, do something like this:Final output:
Hope that helps...