more database escaping
| From: | Dennis Gearon | Date: | Fri, 24 May 2002 05:23:10 +0000 |
| Subject: | more database escaping | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-99050@lists.php.net to get a copy of this message | ||
In setting up a new database, new pages, new site, on a shared server,
these thoughts come to mind:
1/ Does anybody keep a table of config values in which the database was
originally designed for? (and one in each database for a site, for that
matter)
Example
CREATE TABLE site_name_design_cfg_vals(
name VARCHAR(32),
value VARCHAR(32),
PRIMARY KEY name
) TYPE='MYIASM';
Some values I would store, for example, would be:
'single_quote_escape', '''
'double_quote_escape', '\'
Then, before insertions are made into the database, these values are
checked, and only the right values are put in. This makes it easy to
move between sites, or databases.
--
-----------------------------------------------------------------
Joy is just a thing (to be).. raised on,
Love is just the way to Live and Die,
John Denver.
-----------------------------------------------------------------
He lost a friend, but kept his Memory (also John Denver),
Thank you...John Corones...my friend always.
-----------------------------------------------------------------
Look lovingly upon the present,
for it holds the only things that are forever true.
-----------------------------------------------------------------
Sincerely, Dennis Gearon (Kegley)