php mysql/mysqli sql insert id


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.