Hey, all
I've got this script that runs a simple 'select' query:
function set_selectAssoc($usernumber) {
$this->execute = $this->connection->query("SELECT * FROM `link-UsersToGroups` WHERE userID = ".$usernumber);
$this->num_rows = $this->execute->num_rows;
$this->results = $this->execute->fetch_assoc();
if ($this->num_rows == 0) {
$this->response_code = 2;
$this->response_msg .= "You don't currently seem to belong to any groups yet. Would you like to create one?";
}
else {
$this->response_code = 0;
echo "Number of rows found: ".$this->num_rows."<BR>";
do {
echo $this->row["groupID"]."<BR>";
} while ($this->row = $this->results);
}
}
the first echo statement (echo "Number of rows found: ".$this->num_rows."<BR>";
) returns correctly (two rows found), but, when it comes to the 'do...while' block that's supposed to walk through the results, it just echos the groupID of the first row in an endless loop.
Any suggestions?
Thank you!
-Jay
Thanks!