FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » adding a method to a built-in class ?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: adding a method to a built-in class ? [message #179468 is a reply to message #179467] Tue, 30 October 2012 12:38 Go to previous messageGo to previous message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma:
Senior Member
Am 30.10.2012 13:05, schrieb Une BĂ©vue:
> newbie to php5, i'd like to know if i could add a method to a built-in class.
>
> The purpose is to ass #to_sql() method to the String class.
>
> #to_sql() would just replace any oiccurence of the character "'" by two of it "''".

It looks like you want to program your own sql parameter substitution. You should
rather use the functions like mysqli::real_escape_string(), PDO::quote(), or use
prepared statements.



/Str.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How do I turn on graphics (GD2) on a Windows 7 system?
Next Topic: Output status during processing
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Dec 20 14:32:05 GMT 2024

Total time taken to generate the page: 0.04433 seconds