another question. When i try to run the my codes, my json array will end up in repeated loops. Is there any mistakes in my code or do i do it in another way?
<?php
//ini_set('memory_limit','2048M');
$servername = "localhost";
$username = "root";
$password = "imnoob";
$dbname = "csv_db";
$lala = "footfall";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (isset($_POST['tamp_mall'])) {
//$test = $_POST['tamp_mall'];
$result = mysqli_query($conn, "SELECT * FROM tampmall2012, tampmall2013, tampmall2014");
$data_points = array();
while ($row = mysqli_fetch_array($result)){
$point = array("x" => $row['weekid'], "y" => $row[$lala]);
array_push($data_points, $point);
}
echo json_encode($data_points, JSON_NUMERIC_CHECK);
mysqli_close($conn);