i want select then insert in php code but my code do nothing.
public function deliverOrders($id_d){
$p=$this->db->prepare("select saldo from admins where name='".$_SESSION['name']."'");
$orders=$p->fetchAll(PDO::FETCH_OBJ);
return $orders;
if ($orders < 1000){
echo"<script>alert('you deposit less than 1000);</script>";
}
else{
$q=$this->db->prepare("update orders_foods set status=1 where id=?");
if($q->execute([$id_d])){
echo"<script>window.location.href='index.php?page=orders';
alert('berhasil di kirim');</script>";
}
else{
echo"<script>window.location.href='index.php?page=orders';
alert('gagal dikirim');</script>";
}
}