pagination and letering

i hav my data opened in table rows it could be browse by letters. but when i put pagination in it does not show up anything but when i remove the pagination its ok again…please help…

It would help to see what you have for code so far. We shouldn’t need to see every bit of it. Just the chunk or chunks that you are having problems with. Also please give any errors you are getting.

<?php if(isset($_GET['let'])){ $page=""; $limit = 25; $query_count = "SELECT count(*) FROM bookinfo"; $result_count = mysql_query($query_count); $totalrows = mysql_num_rows($result_count); $limitvalue = $page * $limit - ($limit); if(empty($page)){ $page = 1; } $query = "SELECT * from bookinfo where Title like'".Stripslashes($_GET['let']) ."%' ORDER BY Title LIMIT $limitvalue, $limit ";} else{ $query = "SELECT * from bookinfo ORDER BY Title"; } $var1='bgcolor="#E8ECF6"'; echo '
'; echo ''; echo ''; $result = @mysql_query($query); while($row = mysql_fetch_array($result,MYSQL_ASSOC)){ echo "n"; if ($var1=='bgcolor="#FFFFFF"') $var1='bgcolor="#E8ECF6"'; else $var1='bgcolor="#FFFFFF"'; } echo ''; echo '
Books
Book Number Title
{$row['BookNum']} {$row['title']}
'; include('footer.inc'); echo ''; ?>

heres the problem:
$query = “SELECT *
from bookinfo where Title like’”.Stripslashes($_GET[‘let’]) ."%’ ORDER BY Title LIMIT $limitvalue, $limit ";}

when the LIMIT $limitvalue, $limit is present from the select statement it does not show anything if i select the corresponding letter.But if its remove it shows the data…

so does anyone have a solution for this???

what does the mysql_error() say? syntax of the query?

http://dev.mysql.com/doc/mysql/en/SELECT.html

I beleive the limit is supposed to have brackets around it.

Sponsor our Newsletter | Privacy Policy | Terms of Service