Hi, I have a problem with my php/mysql script. It should only output the while loop once but I am getting unlimited loops and an endless page.
$query = mysql_query("SELECT * FROM users WHERE username ='".base64_encode($_SESSION['username'])."' LIMIT 1");
$result = mysql_fetch_array($query);
if(empty($result)){
echo "No user... Error";
}else{
while($row = $result){
?>
<a href="index.php?user=<?=$row['id']?>"><?=base64_decode($row['username'])?></a> | <a href="javascript:void(0);" id="logout">Logout</a>
<?php
}
}
I have tried a similar script with these same lines and it works perfectly
$result = mysql_fetch_array($query);
if(empty($result)){
echo "No user... Error";
}else{
while($row = $result){
//Something
}
}