mysql_fetch_assoc error

Gestart doorSmiegles3 reacties78 weergaven

4 berichten · pagina 1 van 1

Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]koop[/COLOR][COLOR= #007700]])) {[/COLOR]
        [COLOR= #0000BB]$items_check[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM belcredits_winkel 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]koop[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
        [COLOR= #0000BB]$item_check_koop[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$item_check[/COLOR][COLOR= #007700]);[/COLOR]    [COLOR= #FF8000]// 15[/COLOR]
        [COLOR= #0000BB]$item_check_get[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$item_check[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]//16[/COLOR]
        
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$item_check_get[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #DD0000]0[/COLOR][COLOR= #007700]) {[/COLOR]

?>


dag leden ik heb dit stukje code en ik snap gewoon niet wat er wis is
dit is de error

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given in C:xampplitehtdocswinkel.php on line 15

Warning: mysql_num_rows() expects parameter 1 to be resource, null given in C:xampplitehtdocswinkel.php on line 16


(edit door Lennard: duidelijkere titel)
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]koop[/COLOR][COLOR= #007700]])) {[/COLOR]
        [COLOR= #0000BB]$items_check[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM belcredits_winkel 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]koop[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/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]
        [COLOR= #0000BB]$item_check_koop[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$items_check[/COLOR][COLOR= #007700]);[/COLOR]    [COLOR= #FF8000]// 15[/COLOR]
        [COLOR= #0000BB]$item_check_get[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$items_check[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]//16[/COLOR]
        
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$item_check_get[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #DD0000]0[/COLOR][COLOR= #007700]) {[/COLOR]

?>


Probeer hem zo eens en geef dan de foutmelding
0
Berichten
409
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Waarvoor staat de $_GET koop voor?

Pas je standaard waarde in je databese aan naar 1 ipv 0
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Luukvdo schreef:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]koop[/COLOR][COLOR= #007700]])) {[/COLOR]
        [COLOR= #0000BB]$items_check[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM belcredits_winkel 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]koop[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/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]
        [COLOR= #0000BB]$item_check_koop[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$items_check[/COLOR][COLOR= #007700]);[/COLOR]    [COLOR= #FF8000]// 15[/COLOR]
        [COLOR= #0000BB]$item_check_get[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$items_check[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #FF8000]//16[/COLOR]
        
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$item_check_get[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #DD0000]0[/COLOR][COLOR= #007700]) {[/COLOR]

?>
Probeer hem zo eens en geef dan de foutmelding

Dankjewel hij werkt!
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