When running a while script on my local xampp it just returns the same result over and over again, here's the PHP I'm using:
<?php
$id = $_GET['id'];
$getmembers = mysql_query("SELECT * FROM group_memberships WHERE groupid = $id LIMIT 10");
$getids = mysql_fetch_assoc($getmembers);
while($id = $getids['userid']){
$getusers = mysql_fetch_assoc(mysql_query("SELECT look, username FROM users WHERE id = '$id'"));
echo ($getusers['username']);
echo('<br />');
}
?>
All that I get when I execute that is: http://prntscr.com/12nh6g My database contains 4 different users registered to that group. I'm not sure about joining tables in MySQL as I have no idea how to do it.
If I add a break; then it only returns one result, instead of timing out.
Any help is much appreciated!
Also I'm sorry about how messy the PHP is, I am new to this.