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

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

Link to comment
Share on other sites

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.

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.