Created
May 22, 2013 11:20
-
-
Save INDIAN2020/5626847 to your computer and use it in GitHub Desktop.
pdo: lastinsertId
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if( $sql_statement->execute() ) { | |
| $this->db_connect->lastInsertId(); | |
| if( $sql_statement->rowCount() > 0 ) { | |
| $this->previousid = $this->db_connect->lastInsertId('showdate'); | |
| var_dump($this->previousid); | |
| } else { | |
| // no record inserted, therefore error condition exists | |
| echo "No record inserted. Cannot proceed."; | |
| $error = TRUE; | |
| } | |
| } else { | |
| // query failed to execute | |
| echo "Query Failed"; | |
| $error = TRUE; | |
| return false; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment