Jump to content

[SOLVED] Too Many |


ipwnzphp

Recommended Posts

Thanks now i got another issue.

 

$result = mysql_query("SELECT * FROM `CATS` WHERE PING = '1'") or die(mysql_error());
    $count=0;
    $PING = Array();
    while ($row = mysql_fetch_array($result)) { 
    $PING[] = $row[cat_name];
    }
    
    if($count == "3") {
$count = 0;
    echo "<br>";
    }
        echo implode(' | ', $PING);
    $count++;

 

its spoused to echo 3 out and then br than 3 more and its not now.  ???

Link to comment
https://forums.phpfreaks.com/topic/38729-solved-too-many/#findComment-186086
Share on other sites

<?php
  $result = mysql_query("SELECT * FROM `CATS` WHERE PING = '1'")
    or die(mysql_error());
  $count=0;
  $PING = Array();
  while ($row = mysql_fetch_array($result)) { 
    $PING[] = $row[cat_name];
    if($count % 3 == 0) {
      echo implode( ' | ', $PING) . "<br />";
      $PING = Array();
    }
    $count++;
  }
  echo implode( ' | ', $PING) . "<br />";
?>

Link to comment
https://forums.phpfreaks.com/topic/38729-solved-too-many/#findComment-186089
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.