Einbindung einer komplexen MySQL-Abfrage in PHP Ich habe das Problem, dass folgende MySQL-Query allein funktioniert, jedoch nicht, wenn ich sie in PHP einbette. Woran koennte das liegen?
Evtl. an der Trennung der beiden SELECT-Statements durch das ";"? Oder kann ich ggf. gar nicht zwei Abfragen in $sql2 packen? Oder lassen sich bei der Einbettung in PHP keine temporaeren Tabellen erstellen?
$sql2="CREATE TEMPORARY TABLE Kooperationen
SELECT
V_Koop_ID
FROM V_Partner
WHERE Koerpscha_ID = 2;
SELECT
n.Kooperationsform_Label,
l.Land_Label
FROM V_Partner p, Verwaltung v, Kooperationen k, Laender_labels l, Kooperationsform_labels n, V_Koop w
WHERE p.Koerpscha_ID <> \"".$ds_id2."\"
AND k.V_Koop_ID = p.V_Koop_ID
AND p.Koerpscha_ID = v.Koerpscha_ID
AND v.V_Land = l.Land
AND w.V_Koop_ID = n.Kooperationsform
AND w.V_Koopform = n.Kooperationsform
ORDER BY n.Kooperationsform_Label DESC"; |