kann mir die fehlermeldung nicht erklärem
tobi
- php
0 tobi0 Tobias Kloth
hallo, ich hab einen problem mit folgendem code und die drauf kommende fehlermeldung, kann mir allerdings nicht erklären warum das so ist. ich hoffe mir kann einer helfen.
gruß tobi
if (mysql_connect($db_server,$db_user,$db_pwd) || die("Could not contact mySQL!")) {
mysql_select_db($db_base) || die("Connected mySQL, but database is unavailable!");
$sql_cmd = "select projekte.id, projekte.projektname, projekte.gruppe, projekte.kundenname, projekte.strasse, projekte.plz,
projekte.ort, projekte.telefon, projektgruppe.ID, projektgruppe.Name
from projekte, projektgruppe
where projekte.id = '". $project_id ."'
and projekte.gruppe = projektgruppe.ID";
$ret_query = mysql_query($sql_cmd);
if($ret_query){
if ($work_obj = mysql_fetch_object($ret_query)) {
$htmlout = str_replace("<@projekt@>",$work_obj->Projektname,$htmlout);
$htmlout = str_replace("<@gruppe@>",$work_obj->Name,$htmlout);
$htmlout = str_replace("<@kunde@>",$work_obj->Kundenname ,$htmlout);
$htmlout = str_replace("<@strasse@>",$work_obj->Strasse,$htmlout);
$htmlout = str_replace("<@plz@>",$work_obj->PLZ,$htmlout);
$htmlout = str_replace("<@ort@>",$work_obj->Ort,$htmlout);
$htmlout = str_replace("<@telefon@>",$work_obj->Telefon,$htmlout);
$htmlout = str_replace("<@fax@>",$work_obj->Fax,$htmlout);
$htmlout = str_replace("<@mail@>",$work_obj->mail,$htmlout);
}
}
mysql_close();
$htmlout = str_replace("<@projekt@>","",$htmlout);
$htmlout = str_replace("<@gruppe@>","",$htmlout);
$htmlout = str_replace("<@kunde@>","",$htmlout);
$htmlout = str_replace("<@strasse@>","",$htmlout);
$htmlout = str_replace("<@plz@>","",$htmlout);
$htmlout = str_replace("<@ort@>","",$htmlout);
$htmlout = str_replace("<@telefon@>","",$htmlout);
$htmlout = str_replace("<@fax@>","",$htmlout);
$htmlout = str_replace("<@mail@>","",$htmlout);
}
fehlermeldung:
Information: X:\printstamm.php Zeile 20 - Undefined property: Projektname
Information: X:\printstamm.php Zeile 22 - Undefined property: Kundenname
Information: X:\printstamm.php Zeile 23 - Undefined property: Strasse
Information: X:\printstamm.php Zeile 24 - Undefined property: PLZ
Information: X:\printstamm.php Zeile 25 - Undefined property: Ort
Information: X:\printstamm.php Zeile 26 - Undefined property: Telefon
Information: X:\printstamm.php Zeile 27 - Undefined property: Fax
Information: X:\printstamm.php Zeile 28 - Undefined property: mail
ich torfnudel, ich sollte jetzt glaub ich mal ins bett gehen, so scheiße wenn einem so ein dummer fehler unterläuft und man nicht mehr drauf kommt. sorry für die belestigung.
gn8
Hallo Tobi,
$sql_cmd = "select projekte.id, projekte.projektname, [...]";
[...]
$htmlout = str_replace("<@projekt@>",$work_obj->Projektname,$htmlout);
[...]
Information: X:\printstamm.php Zeile 20 - Undefined property: Projektname
ich vermute mal, dass php hier zwischen Groß- und Kleinschreibung unterscheidet - versuch es mal mit $work_obj->projektname (oder verwende gleich mysql_fetch_assoc(), dann kannst du dir die Felder über print_r ausgeben lassen).
Grüße aus Nürnberg
Tobias