Zoeken

Gestart doorOne2xs5 reacties43 weergaven

6 berichten · pagina 1 van 1

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Hallo,

Hoe kan je moppen selecteren via een categorie dus zo:

index.php?cat=algemeen
je krijgt dan de moppen die bij cat algemeen hebben staan.
Iemand een scriptje hoe dit werkt?
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
mysql_query("SELECT * FROM moppen WHERE cat = " . mysql_real_escape_string($_GET[cat]) . "") or die(mysql_error());


O.i.d.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Parse error: syntax error, unexpected T_WHILE in /home/fanhabbo/domains/thahab.nl/public_html/moppen/zoeken.php on line 15


Wat doe ik fout? Script:
Spoiler tonen
<center><head><link rel="stylesheet" type="text/css" href="style.css" />

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" bgcolor="FF5A00" alink="FFD800" vlink="FFD800" link="FFD800">

<a href="insturen.php"><b>MOP TOEVOEGEN</b></a><br /><br />
[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]<?php
  $qLid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM moppen WHERE cat = "[/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]cat[/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]
  [URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$aLid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qLid[/COLOR][COLOR= #007700]))
    {[/COLOR] 
     ?>
<div class="moptop">
                       <div class="tekst"><strong><?=$aLid[titel]?> &#187; Ingestuurd door: <?=$aLid[naam]?> &#187; <?=$aLid[cat]?></a> </strong>
    
<!-- Tekst sluit -->    
</div>

<!-- Mop top sluit -->    
</div>
                       <div class="mopmid">
                           <div class="moptekst"><?=$aLid[mop]?>
                           
<!-- Tekst sluit -->
</div>

<!-- Mop mid sluit -->
</div>                                   
                       <div class="moponder">

<!-- Mop onder sluit -->                                
</div>
  [COLOR= #0000BB]<?[/COLOR]
  [COLOR= #007700]}[/COLOR] [COLOR= #FF8000]//while afsluiten[/COLOR]
  [URL="http://www.php.net/mysql_free_result"]mysql_free_result[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qLid[/COLOR][COLOR= #007700]);[/COLOR] 
  ?>
</center>
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
$qLid = mysql_query("SELECT * FROM moppen WHERE cat = " . mysql_real_escape_string($_GET[cat]) . "") or die(mysql_error()) is niet afgesloten met een ;
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Sevvlor schreef:
$qLid = mysql_query("SELECT * FROM moppen WHERE cat = " . mysql_real_escape_string($_GET[cat]) . "") or die(mysql_error()) is niet afgesloten met een ;
Oja, bedankt!

toevoeging op 19 februari 2012, 171043:
Nu wil ik in:
keur=1 ORDER BY RAND() LIMIT 20

in de code toevoegen hoe moet dat?
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Fanhabbo schreef:
Eerdere citaten tonen
Sevvlor schreef:
$qLid = mysql_query("SELECT * FROM moppen WHERE cat = " . mysql_real_escape_string($_GET[cat]) . " AND keur = 1 ORDER BY RAND() LIMIT 20") or die(mysql_error()) is niet afgesloten met een ;
Oja, bedankt!

toevoeging op 19 februari 2012, 171043:
Nu wil ik in:
keur=1 ORDER BY RAND() LIMIT 20

in de code toevoegen hoe moet dat?
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