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
https://forums.phpfreaks.com/topic/215049-php-counting-echos/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.