OliverL hat geschrieben: das mit der SQL ist mein Fehler. der Prefix der Tabellen ist bei mir "con48" nicht wie bei dir "con"
Hier mal mit den Offizellen Ariablen für die Tabellen:Code: Alles auswählen
$sql = "SELECT ca.idcat, ca.idart, tca.idtpl as tca, tcc.idtpl as tcc
FROM ".$cfg["tab"]["cat_art"]." as ca,
".$cfg["tab"]["art_lang"]." as al
LEFT JOIN ".$cfg["tab"]["tpl_conf"]." as tca
ON al.idtplcfg = tca.idtplcfg,
".$cfg["tab"]["cat_lang"]." as cl
LEFT JOIN ".$cfg["tab"]["tpl_conf"]." as tcc
ON cl.idtplcfg = tcc.idtplcfg
WHERE al.idart = ".$idart."
AND al.idlang = ".$lang."
AND ca.idart = al.idart
AND ca.idcat = cl.idcat";
$db->query($sql);
$iArtTpl = $db->f('tca');
$iCatTpl = $db->f('tcc');
if( $iArtTpl ) $iThisTpl = $iArtTpl;
else $iThisTpl = $iCatTpl;
mfg OliverL
das hab ich schon geändert
wenn ich den $sql string returne bekomme ich
Code: Alles auswählen
TemplateID: SELECT ca.idcat, ca.idart, tca.idtpl AS tca, tcc.idtpl AS tcc FROM con_cat_art AS ca, con_art_lang AS al LEFT JOIN con_template_conf AS tca ON al.idtplcfg = tca.idtplcfg, con_cat_lang AS cl LEFT JOIN con_template_conf AS tcc ON cl.idtplcfg = tcc.idtplcfg WHERE al.idart = 2 AND al.idlang = 1 AND ca.idart = al.idart AND ca.idcat = cl.idcat LIMIT 0 , 30
bastel ich damit in phpMyAdmin rum bekomm ich auch nen ergebnis
aaaaaaaaaber, irgendwie funzt das
nicht wenn ichs auslager
hier mal nen Teil des Code meiner eigenen Klasse
Code: Alles auswählen
class Hauptklasse{
function __construct(){
$this->db = $GLOBALS['db'];
$this->cfg = $GLOBALS['cfg'];
$this->client = $GLOBALS['client'];
$this->lang = $GLOBALS['lang'];
$this->cfgClient = $GLOBALS['cfgClient'];
$this->sess = $GLOBALS['sess'];
}
}
class TemplateID extends Hauptklasse {
function auslesen($idart){
$this->idart = $idart;
$sql = 'SELECT ca.idcat, ca.idart, tca.idtpl AS tca, tcc.idtpl AS tcc'
. ' FROM con_cat_art AS ca, con_art_lang AS al'
. ' LEFT JOIN con_template_conf AS tca ON al.idtplcfg = tca.idtplcfg, con_cat_lang AS cl'
. ' LEFT JOIN con_template_conf AS tcc ON cl.idtplcfg = tcc.idtplcfg'
. ' WHERE al.idart = '.$this->idart.''
. ' AND al.idlang = '.$this->lang.''
. ' AND ca.idart = al.idart'
. ' AND ca.idcat = cl.idcat'
. ' LIMIT 0 , 30';
$this->db->query($sql);
$iArtTpl = $this->db->f('tca');
$iCatTpl = $this->db->f('tcc');
if( $iArtTpl ) $iThisTpl = $iArtTpl;
else $iThisTpl = $iCatTpl;
return $iThisTpl;
}
}
und im output gehts dann so
Code: Alles auswählen
cInclude('classes', 'webtischlerei.class.php');
$oIDtpl = new TemplateID();
$sIDtpl = $oIDtpl->auslesen($idart);
und $sIDtpl ist dann halt leer
