Posts Tagged ‘best practices

There are two main methods for finding random records with PHP (and in this case CakePHP) and MySQL: Use a SELECT query with ORDER BY RAND() and LIMIT x (where x is the number of results you want). Get a list of the primary keys of every record in the table, use PHP to select [...]


top