25.03.2005, 18:56
n'abend jungs
Ich bräucht mal eure Hilfe.
Bei diesem Code hier:
[php:1]
<?php
$news2_sql = "
SELECT
COUNT(c.newsid) AS commentanzahl, n.id, n.name, n.subject, n.news, n.time, n.datum
FROM
controllnews n
LEFT JOIN controllcomments c ON c.newsid=n.id
GROUP BY n.id
WHERE n.id='$new_id'
ORDER BY n.datum DESC";
$news2_result = mysql_query($news2_sql) OR die('<p><pre>' . $news2_sql . '<br />'.mysql_error().'</pre></p>');
[/php:1]
bekomme ich den folgenden Fehler
[code:1]
SELECT
COUNT(c.newsid) AS commentanzahl, n.id, n.name, n.subject, n.news, n.time, n.datum
FROM
controllnews n
LEFT JOIN controllcomments c ON c.newsid=n.id
GROUP BY n.id
WHERE n.id='7'
ORDER BY n.datum DESC
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE n.id='7'
ORDER BY n.datum DESC' at line 7
[/code:1]
Ich check den Fehler irgendwie nicht...
Weiß wer weiter?
Greetz,
White
Ich bräucht mal eure Hilfe.
Bei diesem Code hier:
[php:1]
<?php
$news2_sql = "
SELECT
COUNT(c.newsid) AS commentanzahl, n.id, n.name, n.subject, n.news, n.time, n.datum
FROM
controllnews n
LEFT JOIN controllcomments c ON c.newsid=n.id
GROUP BY n.id
WHERE n.id='$new_id'
ORDER BY n.datum DESC";
$news2_result = mysql_query($news2_sql) OR die('<p><pre>' . $news2_sql . '<br />'.mysql_error().'</pre></p>');
[/php:1]
bekomme ich den folgenden Fehler
[code:1]
SELECT
COUNT(c.newsid) AS commentanzahl, n.id, n.name, n.subject, n.news, n.time, n.datum
FROM
controllnews n
LEFT JOIN controllcomments c ON c.newsid=n.id
GROUP BY n.id
WHERE n.id='7'
ORDER BY n.datum DESC
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE n.id='7'
ORDER BY n.datum DESC' at line 7
[/code:1]
Ich check den Fehler irgendwie nicht...
Weiß wer weiter?
Greetz,
White