PHP & SQL Empty Output when Select username -


i making simple webservice, outputing request json. well, have no idea how done, followed different google examples.

the problem codes give blank output if select username in sql. without username in sql, output fine, strange. not sure if security features or codes have issues. i've confirmed sql username working in phpadmim.

$token = "some simple token"; $headers = apache_request_headers();  if (isset($headers['authorization']) && $headers['authorization'] == $token) {     $connection = mysqli_connect(ip, user, pw, db) or die("error " . mysqli_error($connection));      $sql = "select u.username userid, f.fid4 gw2id mybb_users u, mybb_userfields f u.uid = f.ufid , (additionalgroups = 8 or usergroup = 4 or usergroup = 9 or usergroup = 3) order f.fid4";     $result = mysqli_query($connection, $sql) or die("error in selecting " . mysqli_error($connection));      //create array     $emparray = array();     while($row =mysqli_fetch_assoc($result))     {         $emparray[] = $row;     }     echo json_encode($emparray);      //close db connection     mysqli_close($connection); } 


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -