Hallo zusammen,
Wiedermal ein Problem mit meinem CP^^
Ich habe 2 Tabellen:
members:
Code
mysql> SELECT * FROM members;
+---------+----------+----------------------------------+-------------+---------------------+---------------------+-------+-------------+-------------+--------+---------+-------+------------+-------+--------+------+
| user_id | username | password_md5 | fraction_id | last_login | created_at | warns | bank_credit | admin_level | job_id | skin_id | money | bank_money | level | points | rank |
+---------+----------+----------------------------------+-------------+---------------------+---------------------+-------+-------------+-------------+--------+---------+-------+------------+-------+--------+------+
| 2 | Vince | 81dc9bdb52d04dc20036dbd8313ed055 | 1 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 | 2 | 20000 | 3 | 6 | 251 | 10000 | 5000 | 11 | 2 | 1 |
| 3 | demo | fe01ce2a7fbac8fafaed7c982a04e229 | 1 | 2012-11-26 12:44:39 | 2012-08-13 12:44:50 | 1 | 5000 | 0 | 2 | 12 | 12532 | 4983 | 8 | 4 | 6 |
+---------+----------+----------------------------------+-------------+---------------------+---------------------+-------+-------------+-------------+--------+---------+-------+------------+-------+--------+------+
2 rows in set (0.00 sec)
fractions:
Code
mysql> SELECT * FROM fractions;
+----+--------------------------------+
| id | name |
+----+--------------------------------+
| 1 | Liberty City Police Department |
| 2 | FBI |
| 3 | Medic |
+----+--------------------------------+
3 rows in set (0.00 sec)
Ich möchte nun im CP die Fraktion, sowie den Leader der jeweiligen Fraktion anzeigen lassen.
Sieht bei mir so aus:
PHP
$getplayerfractionid = mysql_query("SELECT fraction_id FROM members WHERE password_md5='".$_SESSION["mypassword"]."'");
$getplayerfraction = mysql_query("SELECT name FROM fractions WHERE id='.$getplayerfractionid.'");
$getfractionleader = mysql_query("SELECT username FROM members WHERE fraction_id='.getplayerfractionid' AND rank='6'");
Ausgegeben wird es dann so:
PHP
echo "Fraktion: " .mysql_result($getplayerfraction, 0, "fractions.name"). "<br>";
echo "Rang: <br>";
echo "Leader: " .mysql_result($getfractionleader, 0, "members.username"). "<br>";
Ich hab so das Gefühl, als stimm was mit den " und ' nicht.^^
Wo liegt das Problem? Überlegungsfehler?
Gruss
Vince
EDIT: Fehler