mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Added a getLastInsertedID method
This commit is contained in:
		@@ -311,6 +311,25 @@ class DBLibrary {
 | 
			
		||||
        return $return;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Get the last inserted ID of a cursor
 | 
			
		||||
     *
 | 
			
		||||
     * @param Nothing
 | 
			
		||||
     * @return Integer The last inserted ID (0 for a failure)
 | 
			
		||||
     */
 | 
			
		||||
    public function getLastInsertedID(){
 | 
			
		||||
        try {
 | 
			
		||||
            //Get & return last inserted ID
 | 
			
		||||
            return $this->db->lastInsertId();
 | 
			
		||||
        }
 | 
			
		||||
        catch(Exception $e){
 | 
			
		||||
            exit($this->echoException($e));
 | 
			
		||||
        }
 | 
			
		||||
        catch(PDOException $e){
 | 
			
		||||
            exit($this->echoPDOException($e));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Get datas from a table
 | 
			
		||||
     * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user