Jump to content

A simple php question


tonyalepski

Recommended Posts

Hi,

I am trying to convert a php function into perl and need to understand the following line in red :

 

 

   function pagination($query, $per_page = 10,$page = 1, $url = '?'){       
     $query = "SELECT COUNT(*) as `num` FROM {$query}";
     $row = mysql_fetch_array(mysql_query($query));
     $total = $row['num'];
        $adjacents = "2";

     $page = ($page == 0 ? 1 : $page); 
     $start = ($page - 1) * $per_page;        
  
     $prev = $page - 1;       
     $next = $page + 1;
        $lastpage = ceil($total/$per_page);
     $lpm1 = $lastpage - 1;
     
     $pagination = "";
     if($lastpage > 1)
     { 

.........................................

 

 

What will be the output of this line above in red.

 

Thank you very much.

Regards.

Tonya

Link to comment
https://forums.phpfreaks.com/topic/290644-a-simple-php-question/
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.