because this should be simple. (I am a relatively new mysql/php user, though)
I have a mysql table with a field containing email addresses. I want to
get all the addresses in that field and concatenate them into a string
like
email1;email2; etc so that each email address is separated with a semicolon.
I have found code to make this happen and print it onto a screen. But I
don't want it printed on a screen. I want to just put it into a variable,
so I can use the variable later. What do I do? Below is the code
Expand|Select|Wrap|Line Numbers
- $query2="SELECT * FROM tablename";
- $result=mysql_query($query2);
- while($row = mysql_fetch_array($result)){
- echo $row['address']."; ";
- }