私はCodeIgniter 2を使用していましたが問題はありませんでしたが、今はCodeIgniter 3を使用していて、mysqlとmysqliに問題があります。mysqlとmysqliで何か問題が発生しました
私のコードは次のとおりです。
<?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); ?>
エラーメッセージ:
mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
と
mysql_fetch_array() expects parameter 1 to be resource, boolean given
誰もがそれを修正する方法を知っていますか?
を解決するために、この次のコードを使用することができます。 MySQLエクステンションがもう利用できないので、mysqliやPDOを使用し始める –
[this](http://php.net/manual/en/function.mysql-query.php)を見ると、 'mysql_query'がfalseを生成するようです'select'を使用するとエラーになります。 –