How can i get all the value of a column(first value to the last value) in my table in php, then put it on a container(array) so i can use the data
to plot the table values on a chart. Im using FusionCharts and i saw an example in which it present a form, ask for inputs from the user and
it plot the values on a table when i click Ok button. By the way the code is written in PHP and it uses $_POST['variable'] thing. I tried to write a code to get all the column values but it only get the first value and its not on an array.
<?php
function dbquery($sql) {
$arr = array();
$conn= odbc_connect('Landingpage','','');
$rs = odbc_exec($conn,$sql);
$x = 1;
while (odbc_fetch_row($rs)) {
for ($y = 1; $y <= odbc_num_fields($rs); $y++)
$arr[$x][$y] = odbc_result($rs,$y);
$x++;
}
if ($x > 1)
return $arr;
}
$arr=dbquery("SELECT * FROM tblUser");
echo $arr[1][1]
?>