I am running into a very weird problem in my PHP script when trying to rename my table name. Instead of renaming it, it is dropping it.
Background Info:
- I am running the script on my browser
- Rename to the original table name happens right after the drop of original table.
Code Example:
$tableSuffix = "1";
$tableSuffix2 = "2";
// This table already exists "testing_$tableSuffix LIKE template_testing"
// This is being created
CREATE TABLE testing_$tableSuffix2 LIKE template_testing
$queryString = "DROP TABLE testing_$tableSuffix";
$query = $db->query($queryString);
$queryString = "RENAME TABLE testing_$tableSuffix2 TO testing_$tableSuffix";
$query = $db->query($queryString);
Renaming is not happening and both testing_$tableSuffix and testing_$tableSuffix2 are dropping and getting deleted.
Looks like I figured out the bug. Not sure yet though why it is happening on Chrome only and not Safari. My script is running 2 instances within 2 seconds on Chrome, however this issue does not happen on Safari.