mysql vraag

Gestart doorMarjolein7 reacties41 weergaven

8 berichten · pagina 1 van 1

Marjolein

Lid · Topicstarter

Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik wil iets ophalen uit me database. Ik heb een kolom "categorie" met daarin 3 verschillende namen o.a. algemeen. Nu wil ik alle rijen ophalen die onder algemeen staan.
Ik doe dus:

$uQuery = mysql_query("SELECT * FROM system_link ORDER BY id WHERE categorie=Algemeen") or trigger_error(mysql_error());


Dit had ik zo opgezocht op google maar dit werkt dus niet? Hoe moet dit dan?
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$uQuery = mysql_query("SELECT * FROM system_link WHERE categorie = Algemeen ORDER BY id") or trigger_error(mysql_error());
0
Berichten
3.000
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]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT ding1,ding2,ding3 FROM tabel"[/COLOR][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]$query[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Er zijn nog geen dingen 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]$rij[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])){[/COLOR]
 
    [COLOR= #0000BB]$ding1[/COLOR] [COLOR= #007700]=[/COLOR] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700]->[/COLOR]ding1[COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$ding2[/COLOR] [COLOR= #007700]=[/COLOR] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700]->[/COLOR]ding2[COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$ding3[/COLOR] [COLOR= #007700]=[/COLOR] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700]->[/COLOR]ding3[COLOR= #007700]);[/COLOR]
    
 
 
 
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"
            <b>ding1:</b> "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ding1[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" <br />
          <b> ding2:</b> "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ding2[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" <br />
           <b> ding3:</b> "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ding3[/COLOR][COLOR= #007700].[/COLOR]" [COLOR= #007700]<[/COLOR]br /[COLOR= #007700]>[/COLOR]
?>
0
Marjolein

Lid · Topicstarter

Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Superb schreef:
$uQuery = mysql_query("SELECT * FROM system_link WHERE categorie = Algemeen ORDER BY id") or trigger_error(mysql_error());
Tnx!
tsjonge, gewoon ff omdraaien...stom stom stom yummie
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Mikek schreef:
[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]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT ding1,ding2,ding3 FROM tabel"[/COLOR][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]$query[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Er zijn nog geen dingen 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]$rij[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])){[/COLOR]
 
    [COLOR= #0000BB]$ding1[/COLOR] [COLOR= #007700]=[/COLOR] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700]->[/COLOR]ding1[COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$ding2[/COLOR] [COLOR= #007700]=[/COLOR] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700]->[/COLOR]ding2[COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$ding3[/COLOR] [COLOR= #007700]=[/COLOR] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700]->[/COLOR]ding3[COLOR= #007700]);[/COLOR]
    
 
 
 
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"
            <b>ding1:</b> "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ding1[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" <br />
          <b> ding2:</b> "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ding2[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" <br />
           <b> ding3:</b> "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$ding3[/COLOR][COLOR= #007700].[/COLOR]" [COLOR= #007700]<[/COLOR]br /[COLOR= #007700]>[/COLOR]
?>
Fetch object schaterschater
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Majorlein, je moet toch eerst iets zoeken voordat je het op orde kan brengen. Is heel logisch biggrin
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Marjolein schreef:
Eerdere citaten tonen
Superb schreef:
$uQuery = mysql_query("SELECT * FROM system_link WHERE categorie = Algemeen ORDER BY id") or trigger_error(mysql_error());
Tnx!
tsjonge, gewoon ff omdraaien...stom stom stom yummie
Geen probleem santabaard
0
Marjolein

Lid · Topicstarter

Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rik schreef:
Majorlein, je moet toch eerst iets zoeken voordat je het op orde kan brengen. Is heel logisch biggrin
Jah emo Daarom staat er ook stom stom stom achter, had ik zelf ook kunnen weten maar ik denk soms gewoon veels te moeilijk 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