-s 主キーmodelSlikeVrijednost
への参照があります。多くの画像を含めることができます (ユーザーによって異なります)。に基づいてフォルダーを削除する必要があります。model
ModelSlikeVrijednost
modelID
パスの例: /home/mainSite/public_html/site/img/1/1/
.
これを行うことは可能ですか?
コード:
if ($stmt = $mysqli->prepare("SELECT modelID FROM model WHERE proizvodacID='$id'")) {
$stmt->execute();
$stmt->bind_result($modelID);
while ($stmt->fetch()) {
$path="/home/mainSite/public_html/site/img/".$id."/".$modelID."/";
if ($stmt1 = $mysqli->prepare("SELECT modelSlikeVrijednost FROM modelSlike WHERE modelID='$modelID'")) {
$stmt1->execute();
$stmt1->bind_result($slike);
while ($stmt1->fetch()) {
if(is_null($slike)){
rmdir($path);
}
else{
$slikePath="/home/mainSite/public_html/site/".$slike;
if($slikePath!=$path){
unlink($slikePath);
}
rmdir($path);
}
}
$stmt1->close();
}
else {
printf("Prepared Statement Error: %s\n", $mysqli->error);
}
}
$stmt->close();
}
このエラーが発生します:Prepared Statement Error: Commands out of sync; you can't run this command now Prepared Statement Error: Commands out of sync; you can't run this command now