HI Folks,
This php error is killing me…
Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’ AND country=‘BGD’’ at line 4’ in /home4/xxx/public_html/visa/content/dashboard/pages/client_admin/visas/visa_alloc/allocate.php:188 Stack trace: #0 /home4/xxx/public_html/visa/content/dashboard/pages/client_admin/visas/visa_alloc/allocate.php(188): PDOStatement->execute(Array) #1 {main} thrown in /home4/xxx/public_html/visa/content/dashboard/pages/client_admin/visas/visa_alloc/allocate.php on line 188
$query = $db->prepare("SELECT *
FROM visas");
$query->execute();
while($row = $query->fetch()) {
$block_number=$row['block_number'];
$pid=$row['position_id'];
$cid=$row['country'];
$number_of_visas=$row['number_of_visas'];
if($number_of_visas==4){
$query1 = $db->prepare("DELETE
FROM visas
WHERE block_number=:block_number
AND position_id=:pid,
AND country=:cid");
$query1->execute(array(':block_number' => $block_number,
':pid' => $pid,
':cid' => $cid));
}
}