I cannot solve this seeming simple problem. I have the following simple code and all I want is to echo the result of $ATL5_Alert_query and separated by a comma (,):
$ATL5_Alert_query = mysql_query("SELECT `Mobile` FROM `dbo_tech_name` WHERE `AlertLevel`= 1");
$dataset = array();
while ($data = mysql_fetch_array($ATL5_Alert_query))
{
$dataset[] = $data;
}
echo implode (",", $dataset);
However, I'm getting "Notice: Array to string conversion "...
In your code
$data
is array as well, so$dataset
becomes an array of arrays, which you cannot concatenate. You should get the searched value by this:or:
or:
If you however cannot change this, and already have your
$dataset
array, you can implode it like that: