Skip to content

Tag: php

echo MySql column names and values

What I need is to have a list name => value to be able to make MySql queries. My problem is, I can access MySql records, but I also need to access table’s column names, what should I change in my code? Thanks ok, so now why can’t I join the values to then make my sql queries? I just

php pchart pie chart problem with 0 value

I have a problem with my pie chart when I have 0 values $MyData->addPoints(array(10,20,20,15,23),”Data”); This works fine and converts to percentages across a pie chart however if any of these values are 0 which could happen as I’m dealing with counts and these are really variables in my …

Pretty-Printing JSON with PHP

I’m building a PHP script that feeds JSON data to another script. My script builds data into a large associative array, and then outputs the data using json_encode. Here is an example script: The above code yields the following output: This is great if you have a small amount of data, but I’d pref…