Ok, I know there are several such questions already asked, but my case is different.
This is a mysql query I am trying to execute.
ALTER TABLE `test`.`that` DROP FOREIGN KEY `FK_that_new`;
ALTER TABLE `test`.`that` ADD CONSTRAINT `that_new_FK` FOREIGN KEY `that` (`Col45`) REFERENCES `new` (`Column 1`) ON UPDATE RESTRICT ON DELETE RESTRICT;
The query is generated through my code. When I used the same query through My HeidiSQL workbench, the query runs fine, executes and gives me result, but while using it through my code it throws me an exception with this error
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ALTER TABLE
test
.that
ADD CONSTRAINTthat_new_FK
FOREIGN KEYthat
(`Col4' at line 1
Bottom Note : Language used PHP, db engine used : PDO. I also tried using USE DB command but still negative result.