Jump to content

Can someone take a look at this to see what the heck I have done !


manhattanpaul

Recommended Posts

Hi there

I am currently trying to create a new display on the following page - mysite4singles.com/manager/users3.php

I want to be able to see at a glance which members have upgraded.

The only problem is, that the members who have upgraded are then repeated under 'Waiting to be registered' and 'Aleady registered' again !

Any thoughts (code below)

Cheers

Paul


[quote]The pages consists of the following code:
[color=purple]<?
include ("../config.php");
include ("../functii_mail.php");
db_connect($dbserver,$dbuser,$dbpass,$dbname);
function get_picture($user_id,$mod=0)
{
//mod daca apare sau nu butonul radio
    $sql="select nume,id from pictures where user_id=$user_id";
    $result=mysql_query($sql);
    $num=mysql_numrows($result);
    if ($num<>0)
    {

      $i=0;
    while ($i<$num)
      {
      $nume=mysql_result($result,$i,"nume");
      $id=mysql_result($result,$i,"id");
      ?>
<p><img src="../user_pic/ <?=$nume?>">
      <?
      if ($mod==1)
      {
      }
      else
      {
      ?>
      <input type="radio" name="id" value="<?=$id?>">
      <br>
  <?}
      $i++;
      }
    }
    else
    {
    echo "This user have no pictures uploaded !";
    }

}

function last_user($aproved=0)
{
  $sql="SELECT count(*) FROM users where approvved=$aproved ";
  $result=mysql_query($sql);
if($result)
{ $count=mysql_result($result,0,"count(*)");
echo '('.$count.')';
}

  $sql="SELECT id,nick FROM users where approvved=$aproved order by data desc ";
  $result=mysql_query($sql);
  $num=mysql_numrows($result);
  if ($num<>0)
  {
    $i=0;
  while ($i<$num)
  {
    $nick=mysql_result($result,$i,"nick");
    $id=mysql_result($result,$i,"id");
    if ($i==$num-1)
    {
    ?>
      <a href="profile.php?id=<?=$id?>" target="mainFrame">
      <?=$nick?>
      </a>
  <?is_online($id);
    }
    else
    {
    ?>
      <a href="profile.php?id=<?=$id?>" target="mainFrame">
      <?=$nick?>
      </a>,
  <?is_online($id);
    }
  $i++;
  }
  }
 
 
 
  $sql="SELECT id,nick FROM users where upgraded='1' order by data desc ";
  $result=mysql_query($sql);
  $num=mysql_numrows($result);
  if ($num<>0)
  {
    $i=0;
  while ($i<$num)
  {
    $nick=mysql_result($result,$i,"nick");
    $id=mysql_result($result,$i,"id");
    if ($i==$num-1)
    {
    ?>
      <a href="profile.php?id=<?=$id?>" target="mainFrame">
      <?=$nick?>
      </a>,
  <?is_online($id);
    }
    else
    {
    ?>
      <a href="profile.php?id=<?=$id?>" target="mainFrame">
      <?=$nick?>
</a>, </p>
<?is_online($id);
    }
  $i++;
  }
  }
 
 
}
echo "Waiting to be registered:";
last_user();
echo "<br>Already registered:";
last_user(1);
echo "<br>Upgraded:";
last_user(2);[/quote]



?>[/color]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.