I got some problem with mysqli_affected_rows, it return 1 all times even update not effected.
$dbConnect = mysql_connect($dbHost, $dbUser, $dbPass);
$dbSelect = mysql_select_db($dbName, $dbConnect);
$sqlprove = mysql_query('UPDATE '.tblAVB.' SET a= "1" WHERE id= "'.$_POST['id'].'" AND Active = "1" ');
$isprove = mysqli_affected_rows($sqlprove);
can any body help me?
If you’re using
mysqlithen you use onlymysqliprefixed functions. You cannot mix and match with the deprecatedmysql_querymethods.In fact, you should not be using
mysql_queryat all if you’re usingmysqli.If you’re just getting started you should be using PDO instead. The
mysqliinterface is better than the legacy one, but it’s fairly annoying and cantankerous compared to PDO.In any case, you must be very careful to always use proper SQL escaping on any and all values.