Search
 
SCRIPT & CODE EXAMPLE
 

PHP

codeigniter order by random

function get_random_page()
{
    $this->db->order_by('id', 'RANDOM');
    or
    $this->db->order_by('rand()');
    $this->db->limit(1);
    $query = $this->db->get('pages');
    return $query->result_array();

}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel where first 
Php :: php json_decode without quotes 
Php :: a facade root has not been set laravel 
Php :: laravel log daily 
Php :: save post data to file php 
Php :: php json string to associative array 
Php :: google translate api php 
Php :: php get total amount of days in month 
Php :: random number laravel faker 
Php :: invalid datetime format 1292 
Php :: name csrf token laravel mismatch 
Php :: php upload from url 
Php :: if browser url is having query string after domain name in it check using php 
Php :: php append to csv 
Php :: laravel wherehas with condition 
Php :: change returning datetime timezone to recalculate with user timezone laravel 
Php :: carbon months between dates 
Php :: laravel eloquent where id not equal to 
Php :: php array json encode key and value 
Php :: laravel new date 
Php :: setinterval php 
Php :: laravel in array blade 
Php :: multiple middleware laravel 
Php :: minus day from carbon date 
Php :: install php 8 ubuntu 
Php :: add log in laravel 8 
Php :: password_hash 
Php :: mac os down upgrade php 
Php :: php pdo check if update query successful 
Php :: php sort array by value length 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =