I'm trying to convert these PDO style statements into mysqli and I've done a lot of the other code but I'm stuck at this point.
It's working in the PDO script, but I'm unsure of how to change these.
I know I can use mysqli_query to execute plainly, but because I'm using bound parameters in these ($values and $values2) I'm not sure the proper way to do that. I realize I may can get away with removing my prepare statements but how can I execute queries with the $values and $values2 parameters?
I'm simply trying to preform a speed comparison between this and PDO so I don't need to have discussions about which is better or why I shouldn't convert these to mysqli, I just don't know exactly how to go about it
$insert = $MysqlConn->prepare($insertPlacement);
$insert = $MysqlConn->prepare($insertPlacement);
$update = $MysqlConn->prepare($updatePlacement);
//Array will contain records that are expired
$checkExisting = $MysqlConn->prepare($expiredCheck);
$existingRslt = $checkExisting->execute($values2);
$count3 = mysqli_fetch_assoc($checkExisting);
//Array will contain records that are valid
$checkExistingValid = $MysqlConn->prepare($validCheck);
$existingVldRslt = $checkExistingValid->execute($values2);
$count4 = mysqli_fetch_assoc($checkExistingValid);
// IF records do not exist, or records exist and today is after expiration date
if(empty($count3) && empty($count4)){
print_r("Inserting");
for($i=0; $i<$row2["QUANTITY"]; $i++) {
$insertRslt = $insert->execute($values);
}
}elseif(!empty($count3)){
print_r("Inserting");
for($i=0; $i<$row2['QUANTITY']; $i++){
$insertRslt = $insert->execute($values);
}
}elseif(!empty($count4)){
print_r("updatin");
for($i=0; $i<$row2['QUANTITY']; $i++){
$updateRslt = $update->execute($values);