Hi
- Apology, I posted this into someone else's question, sorry for any confusion caused. -
I have a problem getting something probably very simple to work but cannot see how to achieve it. The following works perfectly:
<?php
$db = mysql_connect("localhost", "username", "password");
mysql_select_db("helpdesk_calls",$db);
$query = ("select calls from yr2004");
$result = mysql_query($query);
while ($array = mysql_fetch_array($result, MYSQL_NUM)){
foreach ($array as $value) {
echo "$value, ";
?>
However what I want to do is put the array into a comma separated string instead of printing it to screen. I have tried using implode unsuccessfuly. The string is going into a script I have downloaded which places a graph into the browser.
The graph script works when the values are manually inserted and what I need to do is tie the array to the graph and I am done.
Code I used for implode is:
$csv = implode(", ", $array);
Many thanks
- Apology, I posted this into someone else's question, sorry for any confusion caused. -
I have a problem getting something probably very simple to work but cannot see how to achieve it. The following works perfectly:
<?php
$db = mysql_connect("localhost", "username", "password");
mysql_select_db("helpdesk_calls",$db);
$query = ("select calls from yr2004");
$result = mysql_query($query);
while ($array = mysql_fetch_array($result, MYSQL_NUM)){
foreach ($array as $value) {
echo "$value, ";
?>
However what I want to do is put the array into a comma separated string instead of printing it to screen. I have tried using implode unsuccessfuly. The string is going into a script I have downloaded which places a graph into the browser.
The graph script works when the values are manually inserted and what I need to do is tie the array to the graph and I am done.
Code I used for implode is:
$csv = implode(", ", $array);
Many thanks