SQL QUERY
$sql = " INSERT INTO foldertable(`serverToken` , `folderName` , `folderid` , `folderPath` , `createdTime` , `LastEdited` , `previewPath` , `userFolderPathName`)
SELECT (SELECT serverToken FROM `servertoken` WHERE `userToken` = ? LIMIT 1) ,? ,? ,? ,CURRENT_TIMESTAMP() ,CURRENT_TIMESTAMP() ,? ,?
FROM foldertable
WHERE (`folderPath` = ?
AND serverToken = (SELECT serverToken FROM `servertoken` WHERE `userToken` = ? LIMIT 1))
The $sql is working fine. but the problem is in mysqli_stmt_execute returning true when folderPath is not matched but returning false when userToken not found in servertoken database.
I am unable to understand this behavior. I will be grateful if you can explain this.
I think given info is enough to debug this, if not tell me.