Take the 2-minute tour ×

Only the first page works

When i click the links to pages

I get this error

Object not found!


If you think this is a server error, please contact the webmaster. Error 404 localhost Apache/2.4.2 (Win32) OpenSSL/1.0.1c PHP/5.4.4

This is my code

        //connect to our DB
        mysql_select_db( 'test1' ) ;

        //preparing our variable.
        if( !isset( $_GET['p'] ) ) {$_GET['p']=0;}
        $per_page= 6 ;
        $sql=  " SELECT name FROM pagination " ;
        $sql2= " SELECT name FROM pagination  ORDER BY id DESC LIMIT ".$_GET['p']."," . $per_page; 
        $query= mysql_query ( $sql2 ) ;
        $rows=  mysql_num_rows ( mysql_query ( $sql ) ) ;
        $page=  ceil ( $rows / $per_page ) ;

        while( $fetch= mysql_fetch_assoc( $query ) ) {
            echo '<p>' . $fetch['name'] . '</p>' ;

        for( $i=0;$i<$page;$i++ ){

            echo' <a href="index.php?p='. ( $i * $per_page ) . '">'. ( $i + 1 ) .'</a> ' ;


share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

This is an Apache error, meaning that you made some mistake in the HREF.

As far as I can see the href will yield "index.php?p=somevalue" which is a valid URL.

The only possibility I see is that you... don't have an index.php file? (e.g. your actual script isn't called index.php all lowercase, but something else)

share|improve this answer
yes thank u i did a mistake in that –  AxelKishore Jul 20 '12 at 6:25
add comment

Your Answer


