Is there a quick easy way to write the results from the query below to just a comma separate list so between the open/close javascript tags that will appear:
72,Client contact name, 2860 eof
72,Contact Phone, 2888 eol
72,Email address, 2865 eol and so on?
<?php
$data = array();
$results = mysql_query('select account_id, display_name, id from field');
while($result = mysql_fetch_assoc($results)) {
$data[] = $result;
}
?>
<script language="javascript">
???????
</script>
That string is not valid Javascript code. Did you mean the following?
To do that, you can chose to do it in Javascript or PHP. To do it in PHP, use implode.
To do it in Javscript, first pass it over using json_encode then join in Javascript.