munnaz Posted September 19, 2010 Share Posted September 19, 2010 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 https://forums.phpfreaks.com/topic/213789-creating-output-when-number-of-rows-gets-to-each-10/ Share on other sites More sharing options...
PaulRyan Posted September 19, 2010 Share Posted September 19, 2010 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 https://forums.phpfreaks.com/topic/213789-creating-output-when-number-of-rows-gets-to-each-10/#findComment-1112707 Share on other sites More sharing options...
munnaz Posted September 20, 2010 Author Share Posted September 20, 2010 Thanks works perfect Link to comment https://forums.phpfreaks.com/topic/213789-creating-output-when-number-of-rows-gets-to-each-10/#findComment-1113048 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.