Posts

Showing posts from November, 2018

otp sms codeigniter

<?php step2:   public function send_regotp ($number) {         if (!empty($number)) {             $number = '91' . $number;             //echo $number;             $otpId = $this->User_Model-> send_otp ($number);             return $otpId;                   } else {             echo '<h4 style="color:red">Please Enter Valid Number..</h4>';         }     } step2.1: public function send_otp ($number){         require('Textlocal.class.php');           $data['otp'] = random_string('numeric',4);         $data['otp_id'] = random_string('alnum',6);         $this->db->insert('otp',$data);        ...

mysql 1

1. Create Table You would not use the  create table  query every time the script executes in normal scenarios. However, when you start building an application, you need to create database tables. To do so with a primary key, you can use the following query. CREATE TABLE 'emp' ( 'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, 'name' VARCHAR(45) NOT NULL, 'lastname' VARCHAR(45), 'dept' VARCHAR(45) DEFAULT 'sales', PRIMARY KEY ('id') ) ENGINE = InnoDB; The above query creates a table "emp" in the selected database. We will have an "id" column as auto increment and with a PRIMARY KEY constraint, which ensures an incremented integer value is added every time a new row is inserted; the constraint checks for non-duplicate value. The column "dept" is populated by default values ("sales" if no value is supplied). You can specify the "Engine" to be used while creating the ta...