Ok I know how to display the first or last 10 results of a query...
$result = mysql_query("SELECT * FROM messages ORDER BY timemsg DESC LIMIT 10");
In a perfect world all the rows ID's would be in perfect order (i.e.- 10,9,8,7,6,5,4,3,2,1), so to display messages 30 to 40 I would just do LIMIT 30,10
but because of certain unforseen situations the actual results will end up being more like-
457
455
454
453
449
448
447
419
418
410
So I can display the last 10 results in descending order but then to show the "previous 10" results (using the above numbers for an example), I'm thinking I need to somehow
capture the last result in this query (410) so when you hit "previous 10" link it passes it through GET to the next page and the next page will use something like LIMIT $start,10
to display the 10 results with before "410" and so on. Any idea how to do this, I don't think it should be that hard, just can't figure it out. Sorry, if this is in wrong thread,
feel free to move to MYSQL board if it belongs there.. Thanks for any help!
how to get IP address?
hey guys,i have this code which is supposed to get me the IP address of my site visitors:Code: <?php if ($_SERVER['HTTP_X_FORWARD_FOR']) {$ip = $_SERVER['HTTP_X_FORWARD_FOR'];} else {$ip =
Any help with my email script?
I have an email script, I have not tested it, although someone tested it for me and said it worked fine. I started to make modifications to the code after using the basic structure. This is my HTML
php code generators
AllWhilst enjoying learning a new language i have come accross a number of free code generators out there to assist and save a lot of timecan anyone recommend what are the best free code generators
SESSION CHECK WORKS "MOST" of the time... whats going on?
i have a sign in check thats included in every page that is a members only page which is basically all of my pages. that im working on anyways..but heres the code..... that works MOST of the time.
Forms Authentication and Refresh at Login page
Hello,
Disable html within defined tags
I have a mysql database that allows users to enter content with html, but I also want to have a tag that will disable the html between it for example:<a
Anti Spam Code Problems
Ok where do i start? Probably by telling you I have very little working knowledge of PHP and that I have been working on this problem for 3 days and have had no luck!Here we go:I have a rate and
Storing/displaying image urls in a database?
HiBasically I have the following scenario:User chooses picture from list. Picture info is added into the db, including url.However I can't figure out how exactly i should be storing the url for the
Random date selection
i want to select random date with time(hour+minutes+sec) where date is specified(10/22/2009) and timestamp is specified 10-11 am
PHP error (line 38) my website
Hello everyone, I'm new on thisand I got a web site thats got a error not showing the photos onthe page http://www.tozecerdeira.comxa.com/produtos_guitarras.phpcan someone be kind to see wath is