Dartarrow’s Technolodge
  • Home
  • About
  • Social
  • Contact me

My Favorite

  • Kill IE6
  • Loan Calculator
  • Random Delights
  • Vista Komanwel

Tags

acpi battery desktop developers development digi dltk eclipse english firefox games gnome google howto humor IE8 imacros infra java kde kde4 kubuntu linux maemo malaysia malaysiaboleh manglish microsoft morons n900 netbeans nokia php phpeclipse propel pwnd rand setup swiftfox symfony sysadmin ubuntu vim webdev worms

Recent Posts

  • How to test your webcam in Ubuntu
  • Collectd Python plugin
  • N900 development Part 2
  • N900 Development Part 1
  • Maemo SDK installation on Linux
  • DailyChilly recovery after pwned
  • Compaq CQ40 Wireless Driver
  • What you need to know about the Nokia N900
  • 20 things to know about the N900 before buying one
  • Using the Nokia N900 as a modem
  • Benchmarking Google DNS from Malaysia
  • Why you should never piss off your sysadmins
  • Huawei E620 and Linux
  • Swiftfox 3.5.4 and libxul.so
  • Decoding the Female Lingo Part 1 – Requirements

Posts Tagged ‘rand’

June 3rd, 2009
No Comments

Symfony – Propel get random data from table

Somebody asked this on IRC so I figured I might as write it down.

Q: How do I get one random row from a table?

A:

$cnt=MyTable::doCount(new Criteria());
$c = new Criteria();
$c->setOffset(rand(1,$cnt));
$mydata=MyTable::doSelectOne($c);

Read More
All opinions held here are that of my own and does not reflect that of my employer or clients
  • Home
  • About
  • Social
  • Contact me
  • Back to Top