ClanKiller.com http://forums.clankiller.com/ |
|
PHP and Mysql http://forums.clankiller.com/viewtopic.php?f=24&t=815 |
Page 1 of 1 |
Author: | Satis [ Tue May 04, 2004 5:27 pm ] |
Post subject: | PHP and Mysql |
heh...not phpbb, just php...anyway... ok, so I created a table. There are a number of records, and each has a number of fields including date. What's the best way to return only the ten most recent entries? Or at least only print out the ten most recent. I'm mildly stumped. |
Author: | Satis [ Tue May 04, 2004 8:43 pm ] | |||||||||
Post subject: | ||||||||||
Nevermind, I've discovered the wonders of $num_rows. I've written this and it seems to work. Any suggestions for improvement or whatever would be greatly appreciated.
|
Author: | Manuel [ Tue May 25, 2004 8:39 am ] |
Post subject: | Clankiller News |
Tweeking your code: SELECT * FROM clankiller_news ORDER BY 'date' ASC LIMIT 10 |
Author: | Pig [ Tue May 25, 2004 12:32 pm ] |
Post subject: | |
Wow, may 5th. Never saw this post. Yeah, limit 10 is a better way to go. It's also part of pagination if you ever decide to get crazy. |
Author: | Satis [ Tue May 25, 2004 5:32 pm ] |
Post subject: | |
ah, yes, I've come quite a bit further since then. What were you saying about pagination? Anyway, the stuff I'm having issues with now is too long to post. heheheh. |
Author: | Pig [ Tue May 25, 2004 7:06 pm ] |
Post subject: | |
Yes, I'm sure your shrink has reams about the help you need... Pagination is having your results split up onto multiple pages, like these forums. |
Author: | Satis [ Wed May 26, 2004 8:36 pm ] |
Post subject: | |
ah, I understand. I don't plan on doing that with my timecard thing. I've already gotten the reporting function to work, which can get onbovious if you choose a really huge timeframe. But blah, it's only for 2 users. I'm reworking the code on that now. Having issues making it function if lunches aren't taken. But I'll sort it. BTW, I have a love/hate relationship with Unix time. |
Author: | Pig [ Wed May 26, 2004 9:53 pm ] |
Post subject: | |
??? unix timestamps are the shizzle!!!! Blasphemer. Did you read my tut on working with unix timestamps? http://www.webhead.cc/main.php?inv=59 |
Author: | RB [ Thu May 27, 2004 8:31 am ] |
Post subject: | |
Heheh, Pig. You can fix that background imaged code. It would look better if it don't move with scrolls. Just my opinion, of course. {... background-image:url('whatIknow.hell');background-attachment: fixed; ...} |
Author: | Satis [ Thu May 27, 2004 8:48 am ] |
Post subject: | |
hah...I didn't realize you wrote a tut. I just read through it... I'm afraid that I already figured out most of that. Or all of it. btw, why no mention of mktime()? EH?! heh. I use it to figure out the unix timestamp of today (ie, mktime(0,0,0);). I guess time() is close enough. |
Author: | Pig [ Thu May 27, 2004 12:32 pm ] |
Post subject: | |
mktime is retarded in comparison to strtotime(). I honestly can't think of a need for mktime. |
Author: | Satis [ Thu May 27, 2004 5:02 pm ] |
Post subject: | |
mktime is a quick and easy way of finding out today at midnight. It's so quick. I use strtotime for virtually everything else, though, so you're correct in most instances. btw, I finally figured out how to do the no lunch thing. I can't believe I beat my head against a wall for several days for 17 lines of code. Which I coulda squished down into like 9 lines if I really wanted to. Blah, anyway, I'm proud, I finally got the hard part. Now for the rest. |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |