Showing information on a PHP page from a DB...
Posted: Wed Aug 10, 2005 6:14 pm
I am working on an online text-based RPG as i said in my first topic, so i want to show the player his information, so i made a script but it doesn't realy work
... here is the script:
what's the bug here
?
P.S: don't mind the "unknown" chars they are in hebrew...
feyd | you can use the
Code: Select all
{
// I THINK THE PROBLEM IS FROM HERE ----->
$sql1 = "SELECT * FROM users WHERE user = '$_SESSION[username]'";
$sql2 = "SELECT * FROM races WHERE race = '$_SESSION[username]'";
$sql3 = "SELECT * FROM classes WHERE class = '$_SESSION[username]'";
$sql4 = "SELECT * FROM RPG WHERE level = '$_SESSION[username]'";
// UNTIL HERE <-----
$result1 = mysql_query($sql1);
$result2 = mysql_query($sql2);
$result3 = mysql_query($sql3);
$result4 = mysql_query($sql4);
$a=mysql_fetch_array($result1);
$b=mysql_fetch_array($result2);
$c=mysql_fetch_array($result3);
$d=mysql_fetch_array($result4);
// this is all the information i want to view...
$id=$a["id"];
$user=$a["user"];
$race=$b["race"];
$class=$c["class"];
$level=$d["level"];
$HP=$d["HP"];
$MP=$d["MP"];
$offence=$d["offence"];
$defence=$d["defence"];
$speed=$d["speed"];
$wisdom=$d["wisdom"];
$weapon=$d["weapon"];
$weapon2=$d["weapon2"];
$armor=$d["armor"];
$item=$d["item"];
$money=$d["money"];
$resource=$d["resource"];
$clan=$d["clan"];
$clan_rank=$d["clan_rank"];
// THIS IS THE ECHO PART...
echo "<b> $user </b><br>
גזע: $race<br>
רמה: $level<br>
ניסיון: $cXP /<b> $XP </b><br>
חיים: $cHP /<b> $HP </b><br>
--------------<br>
עוצמה: $cMP /<b> $MP</b><br>
התקפה: $offence <br>
הגנה: $defence <br>
מהירות: $speed <br>
חוכמה: $wisdom <br>
--------------<br>
נשק: $weapon <br>
נשק שני: $weapon2 <br>
שיריון: $armor <br>
פריט מיוחד: $item <br>
--------------<br>
כסף: $money
משאבים: $resource
--------------<br>
שבט: $clan
תפקיד בשבט: $clan_rank ";
}P.S: don't mind the "unknown" chars they are in hebrew...
feyd | you can use the
Code: Select all
tags anytime now.. [/color]