Php Array Check If Value Exists Sql Query To Get All Tables