Parse Error / ADODB
Verfasst: Mo 17. Feb 2003, 23:13
Hallo miteinander
Ich bin neu auf contenido-geschmack gekommen und möchte nun bestehende scripts als Module einfügen. Habe allerdings bis jetzt wenig erfolg
. Ich hab da was mit der Variable $DB mitbekommen, aber die Umkehrung hat nichts gebracht. Hat vielleicht jemand von euch eine Idee?
(Der connect auf die DB erfolgt via ADODB 2.5)
Script:
<?php
$DB2 = $DB;
include("../../adodb240/adodb.inc.php");
include("../../dbconn/ascconn.php");
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
$result = $DB2->Execute("select * from tbl_news_news t1 left join tbl_news_user t2 on t1.userid=t2.id left join tbl_news_cat t3 on t1.cat=t3.id");
if ($result === false) die("failed");
else
print '<table width="79%" border="0">';
while (!$result->EOF) {
$fld = $result->FetchField(16);
$type = $result->MetaType($fld->type);
print '<tr><td class="#font11">'.$result->fields[20].
'</td><td width="23%" class="#font11">'.$result->fields[3].
'</td><td width="32%" class="#font11">'.$result->fields[4].
'</td><td width="15%" class="#font11">'.$result->UserDate($result->fields[16],'d.m.Y').
'</td><td width="9%" class="#font11">'.'<A HREF="../detail_manuell.php?'."id_text=".$result->fields[0].
'">Detail</A>'.'<BR>';
$result->MoveNext();
}
print '</table>';
$DB = $DB2;
// $result->Close();
?>
Ich bin neu auf contenido-geschmack gekommen und möchte nun bestehende scripts als Module einfügen. Habe allerdings bis jetzt wenig erfolg

(Der connect auf die DB erfolgt via ADODB 2.5)
Script:
<?php
$DB2 = $DB;
include("../../adodb240/adodb.inc.php");
include("../../dbconn/ascconn.php");
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
$result = $DB2->Execute("select * from tbl_news_news t1 left join tbl_news_user t2 on t1.userid=t2.id left join tbl_news_cat t3 on t1.cat=t3.id");
if ($result === false) die("failed");
else
print '<table width="79%" border="0">';
while (!$result->EOF) {
$fld = $result->FetchField(16);
$type = $result->MetaType($fld->type);
print '<tr><td class="#font11">'.$result->fields[20].
'</td><td width="23%" class="#font11">'.$result->fields[3].
'</td><td width="32%" class="#font11">'.$result->fields[4].
'</td><td width="15%" class="#font11">'.$result->UserDate($result->fields[16],'d.m.Y').
'</td><td width="9%" class="#font11">'.'<A HREF="../detail_manuell.php?'."id_text=".$result->fields[0].
'">Detail</A>'.'<BR>';
$result->MoveNext();
}
print '</table>';
$DB = $DB2;
// $result->Close();
?>