Warning This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0.
Instead, the My SQLi or PDO_My SQL extension should be used.
There are lots of ways to select a random record or row from a database table.
Here are some example SQL statements that don't require additional application logic, but each database server requires different SQL syntax.
Instead, use the internal My SQL SQL function LAST_INSERT_ID() in an SQL query.
The existing create index syntax can create indexes on computed columns, but function-based indexes require additional syntax.
create [unique] [clustered | nonclustered] index index_name on database.]owner.]table_name (column_expression [asc | desc] [, column_expression [asc | desc...) [with ] [on segment_name] [index_partition_clause] prohibits duplicate index values (also called “key values”).means that the physical order of rows on the current database device is the same as the indexed order of the rows.The bottom, or leaf level, of the clustered index contains the actual data pages. If clustered is not specified, nonclustered is assumed.]]