Hi Anton,
I have a script that pulls data from a mysql database. Everything works
really well and it is quite fast. However there can be loads of results. How
do I get the first 10 results and then print a nice button to fetch the next
ten results.
Use LIMIT and OFFSET - you'll find them documented in the MySQL manual. I
should be adding this functionality to my blog script today at some stage,
I'll send you some sample code if I get the chance.
Also is there any way of just getting the first bit of data from a textblod
eg the first paragraph instead of fetching the whole lot
Nope, fraid not, you have to fetch all or nothing. If you only want to
*display* the first paragraph though, you can just explode() the blob on
"\n\n", and print the first element in the array that's returned.
Alternatively, you can use the string functions to grab the first $n
characters. I've seen an "intelligent" function that can do this without
chopping words too - search on phpbuilder.com if that's what you want.
adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.linux.ie/pipermail/webdev/attachments/20000904/86326bc1/attachment.htm
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!