"bruce" <[EMAIL PROTECTED]> wrote on 09/22/2005 09:15:56 PM:
> hi... > > from the docs... it appears the the mysql_real_escape_string function (from > php) is used to backslash a set of chars in the string for insertion into > the mysql db... > > however, given that the '/' is mysql, vs ansi, i was wondering if there's a > way to force it to use the ansi standard "'" instead of the "/". > > this is in a php app, and i'd like to be as standard as possible in the > event i need to change dbs.. > > thanks > > -bruce > [EMAIL PROTECTED] > > The function "mysql_real_escape()" is a MySQL-specific function. It will not properly escape an input string for any other RDMBS. You will need to replace it (and several other PHP functions that all start with "mysql_") if you migrate your code to use any other database system. I don't see how, unless you create or use a database communications abstraction layer, you can write generic database code in PHP. ODBC is just one example of a database abstraction layer. If you wrote your code to use nothing but ODBC functions (no RDBMS-specific SQL code), then pointing your code to use any other database server could be as simple as telling ODBC to use the driver for the other system. Shifting from MySQL-specific code to ODBC (or any other abstraction layer)-specific code will be a major undertaking and should be performed as early in the design and development phases as possible. The later you wait, the harder the shift will be. Shawn Green Database Administrator Unimin Corporation - Spruce Pine