PHP gevorderde |
|
<?
$login =$_SESSION['login'];
$memberid= $_SESSION['id'];
$query2 = mysql_query("SELECT * FROM `login` WHERE id = '$memberid'");
while($object = mysql_fetch_object($query2)){
$cash = $object->cash;
$username = $object->username;
$bullets = $object->bullets;
$gun =$object->gun;
$country =$object->country;
$id=$object->id;
$signupdate = $object->date;
$crew=$object->crew;
$protection=$object->protection;
$formatcash = number_format($cash);
$formatbullets = number_format($bullets);
$health=$object->health;
$datetime = date('D H:i A');
echo "<table border='1' cellspacing='0' cellpadding='0'><tr><td class='btext'><strong>Crew:</strong></td><td class='btext'> $crew</td><td class='btext'><strong>Cash:</strong></td><td class='btext'> $".$formatcash."</td> <td class='btext'><strong>Health:</strong></td><td colspan='3' class='btext'>$health</td></tr>";
echo "<tr><td colspan='5' class='btext'><strong>Gun:</strong></td><td class='btext'> $gun ($formatbullets Bullets)</td><td class='btext'>Protection:</td><td class='btext'>$protection</td></tr></table>";
}
?>
<?}?>
<? $login =$_SESSION['login']; $memberid= $_SESSION['id']; $query2 = mysql_query("SELECT * FROM `login` WHERE id = '$memberid'"); $cash = $object->cash; $username = $object->username; $bullets = $object->bullets; $gun =$object->gun; $country =$object->country; $id=$object->id; $signupdate = $object->date; $crew=$object->crew; $protection=$object->protection; $health=$object->health; $datetime = date('D H:i A'); echo "<table border='1' cellspacing='0' cellpadding='0'><tr><td class='btext'><strong>Crew:</strong></td><td class='btext'> $crew</td><td class='btext'><strong>Cash:</strong></td><td class='btext'> $".$formatcash."</td> <td class='btext'><strong>Health:</strong></td><td colspan='3' class='btext'>$health</td></tr>"; echo "<tr><td colspan='5' class='btext'><strong>Gun:</strong></td><td class='btext'> $gun ($formatbullets Bullets)</td><td class='btext'>Protection:</td><td class='btext'>$protection</td></tr></table>"; } ?> <?}?>
Zo weergeeft hij het niet.. krijg ik gewoon een blanko page, weet iemand wat ik fout doe? Ik weet wel dat het iets te maken heeft met de while lus, want als ik hem sluit vóór de echo's dan doet ie het wel , maar dat moet toch niet?
|