there is such a request
try {$ db-> exec ("DELETE FROM cat
WRERE id
= 5"); } catch (PDOException $ e) {echo 'error'; exit; } The problem is that the data is not deleted, and the exception does not trigger an exception, what could be the problem? If you write
echo $ db-> errorCode (); That outputs 42,000
- oneI hope there is WHERE, not WRERE. Question two :) and a query of the form select * from cat where id = 5 returns at least one record? maybe not what to delete? - KoVadim
- Damn, here I am blind. Then why didn't the exception work? - Andryusha
|
1 answer
If you believe this table , then 42000 is the wrong syntax. What actually can be seen on the code (WRERE instead of WHERE). Why the exception does not work? There is a suspicion that there is not enough piece of code. Look at the example at the end of this page . I suspect that the silent mode is set by default. Change it to $ db-> setAttribute
|