[PHP] Referrals weergeven

Gestart doorNicopara7 reacties42 weergaven

8 berichten · pagina 1 van 1

Nicopara

Lid · Topicstarter

Berichten
3.052
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik heb een GPT-systeem, waarbij je credits krijgt met referrals.
Als een lid een ref is, dan krijgt hij in een tabel het id van diegene die hem heeft aangebracht.

Ik dacht een pagina te maken waarbij je je referrals kon zien.
Met deze code echter zie ik maar 1 refferal.
Wat doe ik fout?

[COLOR= #0000BB]<?
 $sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM gebruikers WHERE ref="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/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= #0000BB]$sql[/COLOR][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]

    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"<p>- "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700]->[/COLOR]naam[COLOR= #007700].[/COLOR][COLOR= #DD0000]"</p> "[/COLOR][COLOR= #007700];[/COLOR] ?>
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je moet het in een while lus steken.À
0
Nicopara

Lid · Topicstarter

Berichten
3.052
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Alemaalte schreef:
Je moet het in een while lus steken.À
Kan je de code geven? bloos
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?
 $query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM gebruikers WHERE ref="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/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]$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]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"<p>- "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700]->[/COLOR]naam[COLOR= #007700].[/COLOR][COLOR= #DD0000]"</p> "[/COLOR][COLOR= #007700];
 }[/COLOR] ?>
0
Nicopara

Lid · Topicstarter

Berichten
3.052
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Het is gelukt.
tnx

Mag slot op.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
En gebruik toch maar mysql_fetch_assoc...
0
Janm

Lid

Berichten
6.170
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?

$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM gebruikers WHERE ref="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or
[URL="http://www.php.net/trigger_error"]trigger_error[/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]$rij[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"<p>- "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700]->[/COLOR]naam[COLOR= #007700].[/COLOR][COLOR= #DD0000]"</p> "[/COLOR][COLOR= #007700];
}[/COLOR] 
?>
0
Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Saliox schreef:
[COLOR= #0000BB]<?

$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM gebruikers WHERE ref="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or
[URL="http://www.php.net/trigger_error"]trigger_error[/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]$rij[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"<p>- "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700]->[/COLOR]naam[COLOR= #007700].[/COLOR][COLOR= #DD0000]"</p> "[/COLOR][COLOR= #007700];
}[/COLOR] 
?>
Helaas.

[COLOR= #0000BB]<?php
$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM gebruikers WHERE ref="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user_id[/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]$rij[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]))
{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<p>- "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</p> "[/COLOR][COLOR= #007700];
}[/COLOR]
?>
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