I have a page that connects through the mysqli class as follows:
# include da classe
class connectionClass extends mysqli{
public $host="localhost",$dbname="banco",$dbpass="",$dbuser="susus";
public $con;
public function __construct() {
if($this->connect($this->host, $this->dbuser, $this->dbpass, $this->dbname)){}
else
{
return "<h1>Erro de conexão/h1>";
}
}
}
page where class calls
require_once 'connectionClass.php';
class webcamClass extends connectionClass{
$query = "INSERT INTO vis_pres_path_foto (fk_id_user_sistema,vis_pres_path_foto_image) ";
$query .= "VALUES('$id_user','$image') ";
$result = $this->query($query);
}
How do I do after insert
above return last
id
of table after insert
in PDO I use $ultimo = $conn->lastInsertId();
but for that case it does not work.