[How to create] – Pagination Without Database MySQL on PHP

May be seen from the title of this post is not familiar to the developers of web -based software.  Make pagination is a must when we have data that can be said to be tens or even hundreds of thousands of web pages. Why should? because how could we be able to access tens or even hundreds of thousands of data on a single page. inefficient is not it?. The following simple code syntax that may be re-developed.

$data = array(
	array('001','AAA'),
	array('002','BBB'),
	array('003','CCC'),
	array('004','DDD'),
	array('005','EEE'),
	array('006','FFF'),
	array('007','GGG'),
	array('008','HHH'),
	array('009','III'),
	array('010','JJJ'),
	array('011','KKK'),
	array('012','LLL'),
	array('013','MMM'),
	array('014','NNN'),
	array('015','OOO'),
	array('016','PPP'),
	array('017','QQQ'),
	array('018','RRR'),
	array('019','SSS'),
	array('020','TTT'),
);

$batas = 10; # FOR LIMIT DATA
$halaman = @$_GET['halaman'];

if(empty($halaman)){
 $posisi = 0;
 $halaman = 1;
 $hingga = $batas;
}else{
 $posisi = ($halaman - 1) * $batas;
 $hingga = $posisi + $batas;
}

$no = $posisi + 1;
$total_data = count($data);

echo '<table cellpadding="4" cellspacing="0" border="2">
 <thead>
 <tr style="background:#000;color:#FFF;">
 <th>No</th>
 <th>Angka</th>
 <th>Huruf</th>
 </tr>
 </thead>
 <tbody>';

 while($posisi < $hingga){

 echo '<tr>
 <td align="center">'.$no.'</td>
 <td>'.$data[$posisi][0].'</td>
 <td>'.$data[$posisi][1].'</td>
 </tr>'; 

 $posisi++; 
 $no++; 
 }
 echo '</tbody>
 </table>';

$jumlah_halaman = ceil($total_data/$batas);
 
echo"<br> Halaman : ";

for($i=1; $i<=$jumlah_halaman; $i++){
 if($i != $halaman){
 echo"<a href=\"sample_paging.php?halaman=$i\">$i</a> | ";
 }else{
 echo"<b>$i</b> | ";
 }
}
 
 echo "<p>Total data : <b>$total_data</b> </p>";

Save the file sample_paging.php on your directory web server and then run in web browser.

if you click next page then display data.

hopefully useful, please try and develop with your version. Bye..bye.

[How to solve] – phpMyAdmin is not working after installed it on Linux

The most annoying thing when we’re trying something new there are obstacles. I discovered this when I tried to install phpMyAdmin on my Linux.

phpmyadmin-is-not-working-01

Initially, I suspect any corrupted files during the installation process. But after I tried to install it several times it was not in the installation process is wrong. After trying trace of my knowledge. I was trying to track it down with the help of Google. Alhamdulillah, I managed to find a similar problem on this forum. then I tried to resolve this problem by following a few stages at the forum. Here are the steps:

1. Open terminal, then open apache2.conf, here are some of the line should be added. You can use gedit, vi or nano. Here I use vi.

phpmyadmin-is-not-working-02

2. Then add the following line to the end of the file.

phpmyadmin-is-not-working-03

3. Save the configuration file with the key combination Esc + : wq. Then restart apache2 service.

phpmyadmin-is-not-working-04

Okay, now you try to run phpMyAdmin on a web browser, running smoothly is not it? Alhamdulillah, now complete web server with phpMyAdmin as database tools

Source :

http://askubuntu.com/questions/55280/phpmyadmin-is-not-working-after-i-installed-it

https://help.ubuntu.com/community/ApacheMySQLPHP#Phpmyadmin%20and%20mysql-admin