Posts

Showing posts from November, 2018

generate unique random number using sql query

SELECT FLOOR(RAND() * 99999) AS random_num FROM numbers_mst  WHERE "random_num" NOT IN (SELECT my_number FROM numbers_mst) LIMIT 1 Selects random number between 0 - 1 using RAND(). Amplifies that to be a number between 0 - 99999. Only chooses those that do not already exist in table. Returns only 1 result.

Codeigniter Hmvc Modules Naming

Go to the Application/config/config.php and define Module location in $config [ 'modules_locations' ] and you are able to access the different location modules in code igniter. $config [ 'modules_locations' ] = array ( APPPATH . 'modules/' => '../modules/' , APPPATH . 'modules/frontend/open/' => '../modules/frontend/open/' , APPPATH . 'new/' => '../new/' , );