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:

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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

android - CoordinatorLayout, FAB and container layout conflict -