Randomly select rows from a LARGE database with MySQL

database

I have a particular database with over one million rows and was required to extract 10 random rows for inclusion on a page that featured products indiscriminately. My initial query looked a little something like this: SELECT id FROM table WHERE something = something ORDER BY RAND() LIMIT 10; The problem with a large table [...]

Working with CSV text files & PHP

csv-icon

I’ve spent the last couple of days writing a parser for flight crew and cabin attendant rosters that will be used by staff I work with at my day job. At the moment, we have access to a Sabre system that outputs rostered duty details… but won’t let us export it into any usable format. [...]

BigDump.php – Importing LARGE MySQL databases

bigdump

This post applies to people that are having problems importing a large database sql dump into their hosting provider’s MySQL server. Most hosting providers use the very popular PHPMyAdmin software for all their user’s online database related administration purposes. It’s visual, intuitive, and it negates the need to use cryptic MySQL commands. Best of all [...]

Parse PHP code stored in database

php-icon

If you have ever tried to access PHP from a database and run it from within your website you will note that it outputs as text, and the server will not parse that PHP code. Following is a great quick-fix that will enable you to store and ‘execute’ PHP code stored from within a database [...]