我有一个PHP代码,必须从mysql表中选择所有字段三个字段,但问题,结果只是2个字段如何修复此错误?
mysql表"用户"
的Fileds:
{"userlist":[{"id":"2","user":"user2"},{"id":"3","user":"michel"},{"id":"4","user":"georges"},{"id":"5","user":"testtest1"}],"success":1}
Run Code Online (Sandbox Code Playgroud)
<?php
/*
* Following code will list all the emp
*/
// array for JSON response
$response = array();
// include db connect class
require_once __DIR__ . '/db_connect.php';
// connecting to db
$db = new DB_CONNECT();
// get all emp from emp table
$result = mysql_query("SELECT *FROM users") or die(mysql_error());
// check for empty result
if (mysql_num_rows($result) > 0) {
// looping through all results
// emp node …Run Code Online (Sandbox Code Playgroud)