Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok so it is possible but you will have to add in some code.</p> <pre><code>function query($id){ $sql="SELECT * FROM attendancein WHERE attendeeid = '$id' "; $result = mysql_query($sql); $items_per_page = 5; $this-&gt;load-&gt;library('pagination'); $config['base_url'] = base_url().'test/query/'.$id.'/'; $config['total_rows'] = mysql_num_rows($result); $config['per_page'] = $items_per_page; $this-&gt;pagination-&gt;initialize($config); $current_page = ($this-&gt;uri-&gt;segment(4) === FALSE ? 0 : intval($this-&gt;uri-&gt;segment(4))); $offset = $items_per_page * ($current_page - 1); $sql="SELECT * FROM attendancein WHERE attendeeid = '$id' LIMIT '$offset', '$items_per_page'"; $result = mysql_query($sql); echo "&lt;table border='1'&gt; &lt;tr&gt; &lt;th&gt;date&lt;/th&gt; &lt;th&gt;In Time&lt;/th&gt; &lt;th&gt;In Status&lt;/th&gt; &lt;th&gt;Class Start Time&lt;/th&gt; &lt;/tr&gt;"; echo "&lt;tr&gt;&lt;td&gt;" . $this-&gt;pagination-&gt;create_links() . "&lt;/td&gt;&lt;/tr&gt;" while($row = mysql_fetch_array($result)) { echo "&lt;tr&gt;"; echo "&lt;td&gt;" . $row['date'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['intime'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['instatus'] . "&lt;/td&gt;"; echo "&lt;td&gt;" . $row['classstarttime'] . "&lt;/td&gt;"; echo "&lt;/tr&gt;"; } echo "&lt;/table&gt;"; } </code></pre> <p>I haven't tested this myself but am pretty sure it will work at any rate it will give you a good idea of what you need to do to get it to work. **Note the 5 can probably be put into a variable to make it more maintainable.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload