mysql - Parse error: syntax error, unexpected '$query' (T_VARIABLE) in /home/****/public_html/get_data_id.php on line 4 -
this question has answer here:
- php parse/syntax errors; , how solve them? 12 answers
im having problem did research , common problem lack of semi colon sure there's nothing wrong in code please check out.
<?php require 'connection.php'; $query = "select id `account_info`"; $res = mysqli_query($connect,$query); $result = array(); while($row = mysqli_fetch_array($res)){ array_push($result, array('id'=>$row[0] )); } echo json_encode(array("result"=>$result)); mysqli_close($connect); ?>
connection.php
<?php define('hostname','mysql.hostinger.ph'); define('user','********_mftis'); define('password','********'); define('databasename','u366906409_mftis'); $connect = mysqli_connect(hostname,user,password,databasename); ?>
write query as
$query = "select * 'account_info'";
Comments
Post a Comment