Sjoerd gaf antwoord op me vraag:
Kan iemand het inbouwen in dit:
Want ik snap er echt niks van. En nu voel ik me zielig
Sjoerd schreef:Maar kan iemand me helpen? Want ik heb veel geprobeerd. Maar het lukt me niet?Haal er in je query gewoon 10 op (ORDER BY id DESC o.i.d.)Eerdere citaten tonen
Nickjexx schreef:Ik heb een script die weergeeft de nieuwste 5 leden, maar nu wil ik dus een button en als je er op klikt krijg je nog 5 resultaten (in totaal 10 dus)
Voor de [func]while[/func] zet je dan iets als $i = 0;
In de while kun je dan doen[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++ ==[/COLOR] [COLOR= #0000BB]5[/COLOR][COLOR= #007700]) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div id="verborgen" style="display: none;">[/COLOR][COLOR= #007700]; }[/COLOR]
Na de while kun je zetten:[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</div><input type="submit" onclick="document.getElementById(verborgen).style.display = lock"/>[/COLOR][COLOR= #007700];[/COLOR]
En dan heb je het zon beetje.
Kan iemand het inbouwen in dit:
[COLOR= #0000BB]<?php
$sql_top_5_members[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT gebruikersnaam,member_id, DATE_FORMAT(regdatum, %d-%m-20%y) AS regdatum FROM leden ORDER BY member_id DESC LIMIT 5"[/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]$i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR]
?>
<table width=200px border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" style="border-bottom:1px solid #00AACD"><strong>Laatste 5 leden:</strong></td>
</tr>
<tr>
<td style="padding-left:14px; padding-top:4px;"><em>Gebruiker</em></td>
<td width="75px" style="padding-top:4px;" align="right"><em>Lid sinds</em></td>
</tr>
[COLOR= #0000BB]<?php[/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]$sql_top_5_members[/COLOR][COLOR= #007700])) {[/COLOR] ?>
<tr>
<td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$i[/COLOR][COLOR= #007700];[/COLOR] ?>. <a href=?p=profiel&mid=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]member_id[/COLOR][COLOR= #007700]];[/COLOR] ?>>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]999[/COLOR][COLOR= #007700]));[/COLOR] ?></a></td>
<td align="right">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]regdatum[/COLOR][COLOR= #007700]];[/COLOR] ?></td>
</tr>
[COLOR= #0000BB]<?php $i[/COLOR][COLOR= #007700]++;
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</table>"[/COLOR][COLOR= #007700];[/COLOR]
?> Want ik snap er echt niks van. En nu voel ik me zielig


59:

