codeigniter return id of last added record
$db = db_connect();
$query = $db->query("SELECT * FROM users ORDER BY id DESC LIMIT 1");
$result = $query->getRow();function add_post($post_data){
$this->db->insert('posts', $post_data);
$insert_id = $this->db->insert_id();
return $insert_id;
}
Also in PHP:
- console.log in pgp
- contain in php
- Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: fileinfo
- + php quantifer
- autoload_namespaces.php failed to open stream: Permission denied
- combine two query value in laravel 8
- check existence of key in array
- array key exist
- TEXT UPPER PHP
- 17th date in php
- error_reporting e_all & e_notice not working
- alphabet and numeric random php
- array shift php
- check a word in a string
- ddev laravel setup
- check if string contains letter php
- "Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52"
- How to add validation form image in laravel
- check if a word exist in a string php
- contains in php string
- array kley exists php
- ethrow exception php
- data type checking php
- count in laravel'