[PHP] Hij ziet hem niet?

Gestart doorRobertt5 reacties30 weergaven

6 berichten · pagina 1 van 1

Robertt

Lid · Topicstarter

Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heey hallo!

Heb weer een klein vraagje, om een of andere manier ziet die mijn clip niet?

[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]id[/COLOR][COLOR= #007700]])) 
 {[/COLOR]
 [COLOR= #0000BB]$cat[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM clipjes WHERE id = $id"[/COLOR][COLOR= #007700];[/COLOR]

    [COLOR= #0000BB]$ophalen[/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/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ophalen[/COLOR][COLOR= #007700]) <[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) {[/COLOR]

    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Helaas het filmpje is niet gevonden!"[/COLOR][COLOR= #007700];

    }[/COLOR]
    [URL="http://www.php.net/else"]else[/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_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ophalen[/COLOR][COLOR= #007700])) 
    {[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Jeeh "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" is gevonden!"[/COLOR][COLOR= #007700];
      
}}}[/COLOR]
?>


Hij zegt helaas geen filmpje gevonden? ik haal het zo op
Quote:
?p=clip&id=1

Weet iemand het?
0
Berichten
1.314
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]id[/COLOR][COLOR= #007700]])) 
 {[/COLOR]
 [COLOR= #0000BB]$id[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM clipjes WHERE id = $id"[/COLOR][COLOR= #007700];[/COLOR]

    [COLOR= #0000BB]$ophalen[/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/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ophalen[/COLOR][COLOR= #007700]) <[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) {[/COLOR]

    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Helaas het filmpje is niet gevonden!"[/COLOR][COLOR= #007700];

    }[/COLOR]
    [URL="http://www.php.net/else"]else[/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_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ophalen[/COLOR][COLOR= #007700])) 
    {[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Jeeh "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" is gevonden!"[/COLOR][COLOR= #007700];
      
}}}[/COLOR]
?>


je had wel $_GET[id] maar niet die $id heette.
dus of je moest in je query $id veranderen in $cat of $cat = $_GET[id]; veranderen in $id = blabla
0
Robertt

Lid · Topicstarter

Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dankje, wat had ik nou fout?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Jij had.

$cat = $_GET[id];
    $sql = "SELECT * FROM clipjes WHERE id = $id";


En je vroeg $id op ipv $cat dus hij heeft $cat veranderd in $id. wink
0
Berichten
1.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
zie mijn editwink
0
Robertt

Lid · Topicstarter

Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Haha woeps yummie
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