I'm having trouble formulating a chart.
I have basically 2 fields: categorias
and dados
. Within categorias
, the information should be arranged as follows: ['categoria 1', 'categoria 2', 'etc']
surrounded by quotation marks and separated by commas. Already within data, the information must come like this: [dado 1, dado 2, dado 3]
without quotes.
I need to get both ( categorias
and dados
) information from a select in a PostgreSQL database, but I only get success in the dados
field since it never comes separated with quotation marks. How can I format to include the quotes?
Here is an example code for the data:
$query="SELECT colunaa from minha tabela";
$output=pg_query($conn,$query);
?>
[<?php while ($result = pg_fetch_array($output)) {?>
<?php echo $result["colunaa"]?>,
<?php } ?>]