Qeury Fout

Gestart doorSmiegles19 reacties47 weergaven

20 berichten · pagina 1 van 2

Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
 $sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM forumberichten ORDER BY `datum` DESC WHERE id="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
 [COLOR= #0000BB]$querys[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/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_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$querys[/COLOR][COLOR= #007700])) {[/COLOR] ?>


en deze error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/lubbo/domains/lubbo.s3.one2xs.com/public_html/pagina/forum.php on line 49


iemand die weet hoe dat komt?
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
 $sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM forumberichten ORDER BY `datum` DESC WHERE id="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
 [COLOR= #0000BB]$querys[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/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/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$querys[/COLOR][COLOR= #007700])) {[/COLOR] ?>


Doe het is gewoon zo?
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dan heb ik nogmaals deze error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/lubbo/domains/lubbo.s3.one2xs.com/public_html/pagina/forum.php on line 48
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$querys = mysql_query(SELECT * FROM forumberichten ORDER BY `datum` DESC WHERE id=".mysql_real_escape_string($_GET[id])."") or die(mysql_error());
while($row = mysql_fetch_array($querys)) { ?>
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Parse error: syntax error, unexpected T_STRING in /home/lubbo/domains/lubbo.s3.one2xs.com/public_html/pagina/forum.php on line 47


Krijg ik dan
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
 $sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM forumberichten WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" ORDER BY datum DESC"[/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_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR] ?>
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Probeer :
$sql = mysql_query("SELECT * FROM forumberichten WHERE id = ".mysql_real_escape_string($_GET[id])." ORDER BY datum DESC");
while($row = mysql_fetch_array($sql)) { ?>
Edit:
Jesse was me voor wink
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
DAnkjewel Jesse
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Werkt hij? smileCrazydog, voortaan is het fijner om er [*code] tags omheen te zetten smile
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja sorry, was begeten zit op ipad Geen zin om aan te klikken xD
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Je kan ze toch ook gewoon typen, hoef je niks voor aan te klikken maar oké, TS werkt hij?
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
weten jullie ook hoe ik een get in de database zet.

$save = mysql_query("INSERT INTO forumberichten(bericht, datum, naam,ip) VALUES(".htmlentities($bericht).", $datum, $naam, $ip)");


heb ik en dan wil ik dat hij het id van de $_GET er ook bijzet weet iemand je hoe dat moet
de tabel heet forumid
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gewoon hetzelfde als je bij je andere query deed
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/lubbo/domains/lubbo.s3.one2xs.com/public_html/pagina/forum.php on line 73


krijg ik bij dit

$save = mysql_query("INSERT INTO forumberichten(forumid,bericht, datum, naam,ip) VALUES("".htmlentities($forumid).",".htmlentities($bericht).", $datum, $naam, $ip)");
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$save = mysql_query("INSERT INTO forumberichten(forumid,bericht, datum, naam,ip) VALUES(".htmlentities($forumid).",".htmlentities($bericht).", ".$datum.", ".$naam.", ".$ip.")");
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