Skip to content

Commit

Permalink
Fix error in Item_model::getFutureId
Browse files Browse the repository at this point in the history
The name of the database was written in code
  • Loading branch information
DidierViret committed Jan 14, 2022
2 parents bc52269 + 8ee8832 commit 7bfac3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion orif/stock/Models/Item_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function initialize(){
* Returns the id that will receive the next item
*/
public function getFutureId(){
$query = $this->db->query("SELECT AUTO_INCREMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'stock' AND TABLE_NAME = 'item'")->getResultArray();
$query = $this->db->query("SELECT AUTO_INCREMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = '{$this->db->database}' AND TABLE_NAME = 'item'")->getResultArray();

// Makes sure we select the auto_increment value
$value = $query[0]['AUTO_INCREMENT'];
Expand Down

0 comments on commit 7bfac3c

Please sign in to comment.