0

Help please, I´m new to JSON and php and I´m getting an error I don´t know why I get.

What´s wrong with my code?

    <?php

$host = "(My real info here)";
$user = "(My real info here)";
$password = "(My real info here)";
$db = "(My real info here)";

$sql = "select * from user;";

$con = mysqli_connect($host, $user, $password, $db);

$result = mysqli_query($con,&sql);

$response = array();

while(&row = mysqli_fetch_array($result))
{

    array_push($response,array("name"=>$row[1]),"class">$row[3]));
}

echo json_encode(array("server_response"=>$response));

mysqli_close($con);
?>

I´m getting: Parse error: syntax error, unexpected ')', expecting '('

0 Answers0