Nieuws Headlines script

Gestart doorShahiem8 reacties45 weergaven

9 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kan iemand me helpen?
Me script vna Newsheadlines geeft dit aan:
Unknown column n.id in group statement

En me code is:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"../config.php"[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"
                        SELECT n.nieuws_id, n.titel, n.datum, l.gebruikersnaam, l.member_id, COUNT(r.reactie_id) AS 

reacties
                                FROM nieuws_berichten AS n
                                LEFT JOIN leden AS l ON n.member_id = l.member_id
                                LEFT JOIN nieuws_reacties AS r ON n.nieuws_id = r.nieuws_id
                                GROUP BY n.id
                                ORDER BY n.datum DESC
                                LIMIT 5
                      "[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
     
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"
<tr><td></td><td>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]datum[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</td><td><a 

href=?p=nieuws&nid="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nieuws_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"</a></td><td>Door: <a 

href=index.php?p=profiel&mid="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]member_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row_member[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"</a></td></tr>
"[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Er zijn geen nieuws berichten gevonden.<br />"[/COLOR][COLOR= #007700];
}[/COLOR]

?>
0
Berichten
11.099
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
zet alles in een topic xd
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"../config.php"[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"
                        SELECT n.nieuws_id, n.titel, n.datum, l.gebruikersnaam, l.member_id, COUNT(r.reactie_id) AS 

reacties
                                FROM nieuws_berichten AS n
                                LEFT JOIN leden AS l ON nieuws_berichten.member_id = l.member_id
                                LEFT JOIN nieuws_reacties AS r ON nieuws_berichten.nieuws_id = r.nieuws_id
                                GROUP BY nieuws_berichten.id
                                ORDER BY nieuws_berichten.datum DESC
                                LIMIT 5
                      "[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
     
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"
<tr><td></td><td>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]datum[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</td><td><a 

href=?p=nieuws&nid="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nieuws_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"</a></td><td>Door: <a 

href=index.php?p=profiel&mid="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]member_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row_member[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"</a></td></tr>
"[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Er zijn geen nieuws berichten gevonden.<br />"[/COLOR][COLOR= #007700];
}[/COLOR]

?>
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nu krijgik dit: Unknown column nieuws_berichten.member_id in on clause
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dan bestaat het veld member_id niet in de tabel nieuws_berichten
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Huh maar die bestaal welconfused
0
Krm

Lid

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dan ?s je conect?e zeker verkeerd
0
Berichten
11.099
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kerem? Kerem is terug woehoeh smile
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je bedoelt online xD
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren