mysql - How do I fill the remaining space with lis in PHP? -


mysql

+-- -+----------+ | id | whatever | +----+----------+ | 1  |  blah1   | +----+----------+ | 1  |  blah2   | +----+----------+ | 1  |  blah3   | +----+----------+ 

php

echo '<ul>'  $a = mysql_query("select * table id = '1' limit 10"); while($b = mysql_fetch_assoc($a)) {     echo '<li>'.$b['whatever'].'</li>'; }  echo '</ul>'; 

output:

<ul>     <li>blah1</li>     <li>blah2</li>     <li>blah3</li> </ul> 

however, want fill remaining space (in case above) 7 empty lis.

so, output should be:

<ul>     <li>blah1</li>     <li>blah2</li>     <li>blah3</li>     <li></li>     <li></li>     <li></li>     <li></li>     <li></li>     <li></li>     <li></li> </ul> 

echo '<ul>'  $a = mysql_query("select * table id = '1' limit 10"); while($b = mysql_fetch_assoc($a)) {     echo '<li>'.$b['whatever'].'</li>'; }  ($i = mysql_num_rows($a); $i < 10; $i++) {     echo '<li></li>'; }  echo '</ul>'; 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -