|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
How can I get a fixed number of Headlines in this PHP script?
Mitch built a Multi-Page Article System script, http://www.devarticles.com/art/1/310 , it works great, but can anyone tell me how I can get a fixed number of headlines to be shown, like 20 or 25 headlines. Instead the entire listing.
THANKS! Last edited by banx : October 14th, 2003 at 07:18 PM. |
|
#2
|
|||
|
|||
|
Notice the sql query:
PHP Code:
Limit takes two parameters ( one is optional ). If you only supply one argument, that argument tells MySql to return at maximum that amount of records. If you supply two arguments, the first is where to start (the offset of first row), the second argument is the max # of records to retrieve. To return 25 records: PHP Code:
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#3
|
||||
|
||||
|
Thanks for replying!
I tried that but then I get this Quote:
And here is whats on line 14 Quote:
Which leaves me to wonder, what could be wrong with line 14? |
|
#4
|
||||
|
||||
|
That usually means you haven't connected successfully to the database or that the query is hosed. Echo your query before executing it and try running it at the command line. If it fails, then you've typoed on the query.
|
|
#5
|
|||
|
|||
|
I thought so too. Which is what really had me scratchin' my noggin'.
It turns out, however, in: Quote:
Duh! Thanks for your help guys! The script looks great now! |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > How can I get a fixed number of Headlines in this PHP script? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|