PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
MDB2 escape question

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database
View previous topic :: View next topic  
Author Message
drew



Joined: 05 Dec 2007
Posts: 2

PostPosted: Wed Dec 05, 2007 7:36 pm    Post subject: MDB2 escape question Reply with quote

I just started using the MDB2 library and I'm trying to use it in our form creation tool. The tool stores templates in an SQL Server 2000 database. The templates contain HTML and field placeholders which look like %FIELD_fieldName%. If I use the MDB2 escape function on these templates I end up with extra brackets([,]) around the % and _ symbols.

I can see that these are the wildcards defined in MDB2_Driver_Common. I'd like to use the escape function to take care of any single quotes that are in the strings, but I can't have all these extra brackets that keep multiplying each time a template is saved.

My question is, what is the correct way to store strings with wildcard characters using MDB2? Do I need to not use the escape function or is there a corresponding unescape that I need to use when I retrieve the data?

Thanks for your help,
Drew
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Wed Dec 05, 2007 9:10 pm    Post subject: Reply with quote

Using quote() seems to be more reasonable for your case:
http://pear.php.net/manual/en/package.database.mdb2.intro-quote.php
Back to top
View user's profile Send private message
drew



Joined: 05 Dec 2007
Posts: 2

PostPosted: Wed Dec 05, 2007 9:57 pm    Post subject: Reply with quote

Yes, that is what I needed.

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software