I was using CodeIgniter 2 back then and didn't got any trouble but now I'm using CodeIgniter 3 and have some trouble over mysql and mysqli for my code.
My code is:
<?php
$query_i = "select MAX(Id_Product) from products";
$result_i = mysql_query($query_i);
$data2 = mysql_fetch_array($result_i);
$MaxID = $data2[0];
$temp = (int)substr($MaxID,2,4);
$temp++;
$NewID = "P".sprintf("%04s",$temp); ?>
error messages :
mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
and
mysql_fetch_array() expects parameter 1 to be resource, boolean given
Does anyone know how to fix it?