Quote:
Originally Posted by evilthoutz
I gave that a shot as well but still no luck. With that code it came out to be like
Code:
$theuserid = $vbulletin->userinfo['userid'];
$result = $vbulletin->db ->query_read("SELECT * FROM vsa_advreg_invite WHERE inviter='$theuserid'");
while($row = $vbulletin->db->fetch_array($result))
{
$getcode = "You invited: " . $row['invited']. "<br> Your Code to Give: ". $row['code'] . "<br>";
}
Still only showing the first result :\ I'm scratchin my head lol
|
There's no way your code is going to return more than one result. Each time through the loop, you reassign the value to the same variable, deleting whatever used to be there. So, $getcode is only going to be equal to the last value it had when the loop ran.
Try this:
PHP Code:
$getcode = '';
$theuserid = $vbulletin->userinfo['userid'];
$result = $vbulletin->db ->query_read("SELECT * FROM vsa_advreg_invite WHERE inviter='$theuserid'");
while($row = $vbulletin->db->fetch_array($result))
{
$getcode .= "You invited: " . $row['invited']. "<br> Your Code to Give: ". $row['code'] . "<br>";
}
(note the concatenation within the loop)