Habe da mal ein Problem:
Ich habe mittels des hier im Forum geposteten Moduls zum Einbinden von PHP-Skripten ein solches Skript eingebunden. Es funktioniert ganz gut. Zusätzlich erzeugt es aber einen Fehlercode diesen Inhalts:
Fatal error: Call to a member function on a non-object in /homepages/7/d28671464/htdocs/contenido/conlib/page.inc on line 68
Bei dem Skript handelt es sich um ein selbstgestricktes Skript zum Auslesen und Anzeigen von bestimmten Datenbankinhalten. Es funktioniert ausserhalb von Contenido blendend und ohne Fehlermeldung.
Das Skript hat diesen Inhalt (am Javascript kann es nicht liegen, da der Fehler auch ohne auftritt):
<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="top">
<tr align="top"><td align="top">
<? //termine_alle.php3
/*Script zur Anzeige der Datenbank*/
$server="xyz";
$user="xyz";
$pass="xyz";
$db="xyz";
$connection=mysql_connect ($server,$user,$pass);
//html_open("Termine");
$query="SELECT Wochtag,Date2,Uhrzeit,Veranst,Thema,Ort1,Ort2,Bemer,Date1,Intnum FROM Termine WHERE Date1 >= CURDATE() AND Verkrzl='grün' OR Date1 >= CURDATE() AND Verkrzl='grüro' ORDER BY Date1 ASC";
$result=mysql_db_query ($db, $query, $connection);
echo "<font id=font1><b>Termine Bündnis 90/Die Grünen</b></font><br>";
//Tabelle füllen
while (list ($Wochtag,$Date2,$Uhrzeit,$Veranst,$Thema,$Ort1,$Ort2,$Bemer,$Verkrzl,$Intnum) = mysql_fetch_row ($result))
{
echo "<br><bR><TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=#FFFFFF>";
echo "<TR ALIGN=LEFT VALIGN=TOP>
<TD BGCOLOR=#ffffff id=font1 HEIGHT=18 WIDTH=50%><B>$Wochtag, $Date2, <br>$Uhrzeit</B> </TD>
<TD id=font1 HEIGHT=18 BGCOLOR=#ffffff WIDTH=10%><img src=http://www.gruenesmv.de/images/clearpixel.gif width=1 height=1 alt=leer></td>
<TD id=font1 HEIGHT=18 BGCOLOR=#ffffff>$Ort1,<br>$Ort2</TD>
</tr>
</table>";
echo "<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=#FFFFFF>";
echo "
<TR ALIGN=LEFT VALIGN=TOP>
<TD BGCOLOR=#ffffff id=font1 HEIGHT=18>";
?>
<a href="#" onclick="javascript:window.open('http://www.gruenesmv.de/cbgruen/templat ... detail.php?<? echo "Intnum=$Intnum"; ?>','Fenster','width=430,height=470,scrollbars=yes');"><? echo "$Thema";
echo "</a><br><br></TD></TR>
<TR ALIGN=LEFT VALIGN=TOP>
<TD id=font1 HEIGHT=1 BGCOLOR=#eaeaea WIDTH=100%><img src=http://www.gruenesmv.de/images/clearpixel.gif width=1 height=1 alt=leer></td></tr>
</table>";
}
//html_close();
echo "<br>";
//html_open("Termine");
$query="SELECT Wochtag,Date2,Uhrzeit,Veranst,Thema,Ort1,Ort2,Bemer,Date1,Intnum FROM Termine WHERE Date1 >= CURDATE() AND Verkrzl='hbs' ORDER BY Date1 ASC";
$result=mysql_db_query ($db, $query, $connection);
echo "<font id=font1><b>Termine Heinrich-Böll-Stiftung MV</b></font><br>";
//Tabelle füllen
while (list ($Wochtag,$Date2,$Uhrzeit,$Veranst,$Thema,$Ort1,$Ort2,$Bemer,$Verkrzl,$Intnum) = mysql_fetch_row ($result))
{
echo "<br><bR><TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=#FFFFFF>";
echo "<TR ALIGN=LEFT VALIGN=TOP>
<TD BGCOLOR=#ffffff id=font1 HEIGHT=18 WIDTH=50%><B>$Wochtag, $Date2, <br>$Uhrzeit</B> </TD>
<TD id=font1 HEIGHT=18 BGCOLOR=#ffffff WIDTH=10%><img src=http://www.gruenesmv.de/images/clearpixel.gif width=1 height=1 alt=leer></td>
<TD id=font1 HEIGHT=18 BGCOLOR=#ffffff>$Ort1,<br>$Ort2</TD>
</tr>
</table>";
echo "<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=#FFFFFF>";
echo "
<TR ALIGN=LEFT VALIGN=TOP>
<TD BGCOLOR=#ffffff id=font1 HEIGHT=18>";
?>
<a href="#" onclick="javascript:window.open('http://www.gruenesmv.de/cbgruen/templat ... detail.php?<? echo "Intnum=$Intnum"; ?>','Fenster','width=430,height=470,scrollbars=yes');"><? echo "$Thema";
echo "</a><br><br></TD></TR>
<TR ALIGN=LEFT VALIGN=TOP>
<TD id=font1 HEIGHT=1 BGCOLOR=#eaeaea WIDTH=100%><img src=http://www.gruenesmv.de/images/clearpixel.gif width=1 height=1 alt=leer></td></tr>
</table>";
}
echo "<br>";
//html_close();
?>
</td>
</tr>
</table>
Problem bei Skript-Include
Hi Sausi,
also zuerst solltest Du
$server="xyz";
$user="xyz";
$pass="xyz";
$db="xyz";
$connection=mysql_connect ($server,$user,$pass);
rausschmeißen, weil ein Connect zur Datenbank schon presistent von Contenido existiert.
Die Variable $db darfst Du nicht benutzen, da dies schon ein Objekt innerhalb von Contenido ist. Deshalb auch die Fehlermeldung.
mysql_db_query ($db, $query, $connection);
solltest Du ersetzen mit
mysql_db_query ($db, $query);
Gruß Björn
also zuerst solltest Du
$server="xyz";
$user="xyz";
$pass="xyz";
$db="xyz";
$connection=mysql_connect ($server,$user,$pass);
rausschmeißen, weil ein Connect zur Datenbank schon presistent von Contenido existiert.
Die Variable $db darfst Du nicht benutzen, da dies schon ein Objekt innerhalb von Contenido ist. Deshalb auch die Fehlermeldung.
mysql_db_query ($db, $query, $connection);
solltest Du ersetzen mit
mysql_db_query ($db, $query);
Gruß Björn