Re: addslashes() vs. magic_quotes_gpc

From: Date: Mon, 20 Oct 2003 04:51:54 +0000
Subject: Re: addslashes() vs. magic_quotes_gpc
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-166730@lists.php.net to get a copy of this message
If you are doing both addslashes() and have magic_quotes_gpc turned on, then yes, you are double-escaping things. From a performance-perspective I doubt you could measure much difference, but I suppose doing it through magic_quotes_gpc would be faster assuming you need to escape all your GPC data. If you have a lot of GPC data that doesn't need to be escaped, then only running addslashes() on the data that needs it might be more efficient. -Rasmus On Mon, 20 Oct 2003, Jake McHenry wrote: > If you have magic_quotes_gpc = On in your php.ini file, which it is by > default, does one still need to have the addslashes function in their > coding? > > When I'm inserting into my database, I have addslashes in place, and I > haven't change the default value of magic_quotes_qpc = On. I havn't > seen any side effects from this. It seems like it's doing this job > twice. > > Would any speed difference be seen by using / not using either of > these? I currently have 3 databases, roughtly 25 tables each, with > roughly 500 entries in each (growing about 50 daily), and it's > starting to get sluggish when I do a select * from tablename. I need > to recover all the speed I can. > > If anyone has any other little tweaks I can do to gain performance, > that would be helpful. > > Thanks, > Jake McHenry > Nittany Travel MIS Coordinator > http://www.nittanytravel.com > >

« previous php.general (#166730) next »