php - Get data except for data in a column -
so have following code: require_once('db.php'); $getusers = mysqli_query($db, 'select * users'); $rows = []; while ($r = mysqli_fetch_assoc($getusers)) { $rows[] = $r; $getskills = mysqli_query($db, "select * skills id = '" . $r['id'] . "'"); while($r = mysqli_fetch_assoc($getskills)) { $rows['skills'] = $r; } } print(json_encode($rows)); which outputs: [{"id":"1","name":"user1","skills":{"woodcutting":"6","mining":"10"}},{"id":"2","name":user2"}] there 2 problems: i'd of data in table skills except id, or at-least cut off before encoding json. for reason can't "skills" shown after first user. user2 should have skills object. what doing wrong? to columns except id table skills , can either list columns want select, this: mysqli...