|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Need help with Mysql statement
This is a part of my code, how to add selection criteria into the select * from table limit 5,5 where bookid<30; There are hundreds of records in the table which I only want those match the selection criteria.
The program can run properly without the "where" at the end of SQL statement. $query = "SELECT * FROM booklist LIMIT " . $start . ", ".$_SESSION["pageno"]." where bookid < 30 "; Does anybody know whether can put where behind the LIMIT or not?? Please help, thanks. |
|
#2
|
||||
|
||||
|
RE: Need help with Mysql statement
Are you trying to do pagination? The LIMIT goes at the end, and what you need to do is find a way to pass the limit values (most likely in a query string as part of the URL) so you can return x number of values starting with record y.
|
|
#3
|
|||
|
|||
|
RE: Need help with Mysql statement
Thanks bakertrg,
I have found the solution for the statement, actually I should write in this way: SELECT * from table where bookid<30 limit 10,10; Anyway, thanks. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Need help with Mysql statement |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|