I was having problems with getting the inserted id, and did a bit of testing. It ended up that if you commit a transaction before getting the last inserted id, it returns 0 every time, but if you get the last inserted id before committing the transaction, you get the correct value. up...
If LAST_INSERT_ID(expr) was used to generate the value of AUTO_INCREMENT, it returns the value of the last expr instead of the generated AUTO_INCREMENT value. Returns 0 if the previous statement did not change an AUTO_INCREMENT value. mysqli_insert_id() must be called immediately after...
* returns user details */publicfunctionstoreUser($name, $email, $gcm_regid){// insert user into database$c =newDB_Connect(); $d = $c->connect(); $test = mysqli_query($d,"SELECT * class_details where code='{$email}'");if($test) { $result = mysqli_query($d,"INSERT INTO ...
* Returns the item corresponding to the value specified for the primary key. * * Add authorization or any logical checks for secure access to your data * * *@returnstdClass */publicfunctioncreateTraceInTimeline($item){ $stmt = mysqli_prepare($this->connection,"INSERT INTO $this->tablename...