Search
 
SCRIPT & CODE EXAMPLE
 

PHP

codeigniter return last inserted id

   $this->db->insert('posts', $post_data);
   $insert_id = $this->db->insert_id();
   return  $insert_id;
Comment

how to get last id in database codeigniter 4

  $db = db_connect();
  $query = $db->query("SELECT * FROM users ORDER BY id DESC LIMIT 1");
  $result = $query->getRow();
Comment

PREVIOUS NEXT
Code Example
Php :: eloquent update row response 
Php :: web api return json example in php 
Php :: in array php multiple values 
Php :: laravel create new migration 
Php :: show time laravel 
Php :: laravel truncate string laravel 8 
Php :: date format change in laravel blade 
Php :: prevent xss php 
Php :: laravel 8 try catch 
Php :: how to store file in public folder laravel 
Php :: laravel rename table 
Php :: php check if post file is empty 
Php :: php check if class exists 
Php :: woocommerce add to cart hook 
Php :: laravel create or update eloquesnt 
Php :: next year php string 
Php :: big int php 
Php :: wp get_posts return ids 
Php :: php Convert String containing commas to array 
Php :: php date set utc hours 
Php :: laravel required_if 
Php :: mysqli fetch row assoc 
Php :: Wordpress disable admin bar to users except admin 
Php :: php has constant 
Php :: laravel eloquent select case when 
Php :: php ternary shorthand 
Php :: Display the image on the front end from category taxonomy 
Php :: php if in array 
Php :: laravel db inserr 
Php :: php faker long text 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =