Fixing a bug in table mysql script