Created
February 4, 2012 01:16
-
-
Save bdenckla/1734236 to your computer and use it in GitHub Desktop.
Escape SQL (MySQL?) database name for grant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function escape_database_for_grant( $d ) | |
{ | |
$search = array( '_', '%' ); | |
$replace = array ( '\_', '\%' ); | |
return str_replace( $search, $replace, $d ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment