php会话

时间:2017-03-25 11:48:49

标签: php

我有一个显示用户下线信息的代码,我想要一个代码来显示该用户的上线详细信息。 困惑?

  

什么是上线和下线?

     

好的,例如我是爵士乐,我把John推荐到这个网站,John注册了我的链接,例如stackoverflow.com/signup?ref=jazz。所以现在john是我的 Downliner 而且他是 upliner

  <?php
$sqlquery="SELECT username,country,doj,pcktaken FROM affiliateuser where referedby='".$_SESSION['username']."' ORDER BY Id DESC LIMIT 1"; //fetching website from databse
$rec2=mysqli_query($con,$sqlquery);
$row2 = mysqli_fetch_row($rec2);
$referusername=$row2[0];
$refcountry=$row2[1];
$refdate=$row2[2];
$refpckid=$row2[3];
$sqlquery11="SELECT name FROM packages where id = $refpckid"; //fetching no of days validity from package table from databse
$rec211=mysqli_query($con,$sqlquery11);
@$row211 = mysqli_fetch_row($rec211);
$refpckname=$row211[0]; //assigning we

                          ?>

以上代码将显示下线器的详细信息。我想要一个代码,它将显示登录用户会话的upliners详细信息。谢谢

1 个答案:

答案 0 :(得分:0)

我已将其整理出来只是为了在affiliateuser&#34; upline&#34;中创建一个新行。并从那里选择。

<?php
$sqlquery="SELECT username,country,doj,pcktaken FROM affiliateuser where upline='".$_SESSION['username']."' ORDER BY Id DESC LIMIT 1"; //fetching website from databse
$rec2=mysqli_query($con,$sqlquery);
$row2 = mysqli_fetch_row($rec2);
$referusername=$row2[0];
$refcountry=$row2[1];
$refdate=$row2[2];
$refpckid=$row2[3];
$sqlquery11="SELECT name FROM packages where id = $refpckid"; //fetching no of days validity from package table from databse
$rec211=mysqli_query($con,$sqlquery11);
@$row211 = mysqli_fetch_row($rec211);
$refpckname=$row211[0]; //assigning we

                          ?>