Jump to content

php counting echos


tom2k7

Recommended Posts

ok my code is below but i want to count how many $sname or ['member_name'] there is as if there is 4 or more i want it to add a marquee to it  have that sorted but im having trouble getting it to count can you help me?

 

$query = "SELECT * FROM `ibf_members` WHERE member_group_id = '4' or member_group_id = '6' or member_group_id = '17' or member_group_id = '18' or mgroup_others = '4' or mgroup_others = '6' or mgroup_others = '17' or mgroup_others = '18' "; 

$result99 = mysql_db_query("pbf99_backup", $query);
$staff1 = mysql_num_rows($result99);
if ($result99) 
{  
while ($r = mysql_fetch_array($result99)) { // Begin while 
$sid = $r["member_id"];
$smgid = $r["member_group_id"];


$query2 = "SELECT * FROM `ibf_sessions` WHERE member_id = '$sid'"; 
$result2 = mysql_db_query("pbf99_backup", $query2); 
if ($result2) 
{  
while ($r2 = mysql_fetch_array($result2)) { // Begin while 
$sname = $r2["member_name"]; 

$query3 = "SELECT * FROM `ibf_groups` where g_id = '$smgid'"; 
$result3 = mysql_db_query("pbf99_backup", $query3); 
if ($result3) 
{  
while ($r3 = mysql_fetch_array($result3)) { // Begin while 
$ssuffix = $r3["suffix"];
$sprefix = $r3["prefix"];

echo "<a href='$host$sid' target='_parent'>$sprefix$sname$ssuffix$stafff</a><br><br>";
}}}}}}

?>

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.