Lets say I have 3 user profiles in a MySQL DB:
|username|ID|group_id|deleted|admin_of_group|
------------------------------------------------------------
|test1......| 1|........2|.......0|............person|
|bob........| 2|........1|.......0|..........abcedea|
|gary.......| 3|........2|.......1|............person|
------------------------------------------------------------
The following code:
[syntax=php]<?php while($user = mysql_fetch_array($usr_list)){ ?>
<td><?php echo $user['username']; ?></td>
<td><?php echo $user['id']; ?></td>
<?php } ?>[/syntax]
Will only show 2 of the 3 DB entries.
My SQL query:
[syntax=php]$usr_list = mysql_query("SELECT * FROM acc WHERE `group_id` = '{$gid}' AND `deleted` = 0 AND `admin_of_group` = '{$session_NAME}'");[/syntax]
I'm pretty sure that its not the query, because I tried it directly in phpMyAdmin with no issues.
However if I order the results by username, then it would show the result previously hidden, and hide one of the results previously shown.
I have tried using a var_dump() in the while loop, and it only returned:
bool (false)
And because a while loop only runs when the input is true...
I simply don't know whats making it false :/