I get the following error: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65488 bytes).
<?php
session_start();
require'class/DB.php';
$db = new clsDB();
$getRows = $db->getRows("SELECT * FROM category");
echo "<form method=\"post\" action=\"category.php\">
<table>";
while($row = $getRows->fetch()){
?>
<tr><td><input type="checkbox" name="checkbox[]" value="<?php echo $row['catId'] ?>"><?php echo $row['catName'];?></td>
<br />
</tr>
<?php
}
?>
</table>
<input type="submit" name="delete" value="delete">
</form>
<?php
if(isset($_POST['delete'])) {
foreach ($_POST['checkbox'] as $check) {
//$deleteRow = $db->deleteRow("DELETE FROM category WHERE catId ='" . $check . "' ");
$deleteRow = $db->deleteRow("DELETE FROM category WHERE catId = ? ", $check);
}
}
?>
This is the line where I got the error
public function deleteRow($query, $params = []){
$this->deleteRow($query, $params);
}
the line is from my DB class
I don't know how to fix this problem please leave something helpful