Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

how to add edit and delete options beside every result ?

$
0
0

Hi 

I'm working in a project and I just finished the pagination system (in every page 2 results) but my problem is that I want to add some options beside every result.For example I have to resut which are (john,katy)I want them to be like this :

John (Edit) (Delete)

Katy (Edit) (Delete)

 

This is my code :

<?php
include("wasata/inc/config.php");
mysql_query('SET NAMES "UTF-8"');
if(!isset($_GET['page'])){
	$page = 1;
}else{
	$page = (int) $_GET['page'];
	$records_at_page = 2;
	$q = mysql_query('SELECT * FROM serv');
	$records_count = @mysql_num_rows($q);
	@mysql_free_result($q);
	$page_count = (int) ceil($records_count / $records_at_page);
	if(($page > $page_count) || ($page <= 0)){
		mysql_close($con);
		die('No More Pages');
	}
	$start = ($page - 1) * $records_at_page;
	$end   = $records_at_page;

	if($records_at_page != 0){
		$q = mysql_query("SELECT * FROM serv ORDER BY id ASC LIMIT $start,$end");
		while($o = mysql_fetch_object($q)){
			echo $o->title .'<br />';
		}
	}
	echo '<br />';
	for($i = 1; $i<= $page_count; $i++){
		if($page == $i){
			echo $page;
		}else{
			echo '<a href="m.php?page=' .$i . '">' .$i . '</a>';
			if($i != $page_count){
				echo ' - ';
			}
		}

	}
}
mysql_close($con);
?> 

So can any one Help please.

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles