We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

gdonald on 09/26/06


Tagged

mysql insert id mysqli


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

vali29


php mysql/mysqli sql insert id


Published in: PHP 


  1. function sqlInsertID()
  2. {
  3. if( in_array( 'mysql', $GLOBALS[ 'loaded_extensions' ] ) )
  4. {
  5. return @mysql_insert_id();
  6. }
  7. elseif( in_array( 'mysqli', $GLOBALS[ 'loaded_extensions' ] ) )
  8. {
  9. return @mysqli_insert_id( $GLOBALS[ 'dbHandle' ] );
  10. }
  11. }

Report this snippet 

You need to login to post a comment.