Jump to content

Creating output when number of rows gets to each 10


munnaz

Recommended Posts

Hey guys was wondering if anyone could modify the code below to have $output = 'yes' if the number of rows equal 10, 20, 30, 40, 50, 60, 70, 80......... etc

 

$dbhost = '******';
$dbuser = ''******';';
$dbpass = ''******';';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('MYSQL N/A - Please Contact Admin');

$dbname = ''******';';
mysql_select_db($dbname);

$query="SELECT * FROM documentaryinfo";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close($conn);
?>

 

Thanks

--------------------------------------------------------------------------------------------------------

Watch Free Documentaries Online - The Documentary Database

www.free-documentaries-online.com

--------------------------------------------------------------------------------------------------------

Try the following...

 

<?
  $dbhost = '******';
  $dbuser = ''******';';
  $dbpass = ''******';';
  $dbname = ''******';';

  $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('MYSQL N/A - Please Contact Admin');
  mysql_select_db($dbname);

  $query  = "SELECT * FROM documentaryinfo";
  $result = mysql_query($query);
  $num    = mysql_numrows($result);

  if(is_int($num/10)){
    $output = 'yes';
  }

  mysql_close($conn);
?>

 

Tell me how is goes bud.

 

Regards, Paul.

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.