Zitat von BlackShadow
wenn das alles so einfach wäre
weiss nicht wie ich das am besten realisieren soll
in *.php und mysql
zu jedem bild soll es kommentare geben und verschiedene rubriken
wie fun, stammgäste, team,
|
[OT]
Hört sich doch einfach an.
Tabelle1 pics
picID (int) (key)| picComment (text) | picData (blob) | picType (10) | picHight (4) | picWidth (4)
Tabelle2 PicClassAssignment
picID (int) (key) | ClassID (int) (key)
Tabelle3 PicClasses
ClassID (int) (key) | ClassName (255)
So und dann kannst du Abfragen fahren die z. B. so aussehen:
SELECT *
FROM
pics AS A,
PicClassAssignment AS B,
PicClasses AS
WHERE
A.picID = B.picID
AND
B.ClassID = C.ClassID
ORDER BY
A.picID
[... query ausführen fehlerprüfung etc...]
$container = array()
while ($res = mysql_fetch_array()) {
$container[$res['picID']][picID] = $res['picID'];
$container[$res['picID']][picComment ] = $res['picComment '];
$container[$res['picID']][picData ] = $res['picData '];
$container[$res['picID']][picType ] = $res['picType '];
$container[$res['picID']][picHight ] = $res['picHight '];
$container[$res['picID']][picWidth ] = $res['picWidth '];
$container[$res['picID']][classes][$res['ClassID'] = $res['ClassName'];
}
tata und fertig ist dein array, dass du dann mit einer foreach schleife schön sauber ausgeben kannst. (in Smarty oder wo auch immer).
(P. S. Die Sache mit den Classes ist nicht ganz so sauber - sollte aber für den Anfang reichen - die Saubere Art war mir zu lange :-)
hoffe, das hat dir geholfen
[OT]