3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 20, 2012   (RSS)

By terryally - April 20, 2012

Hi guys,

My server is now using PHP 6, therefore I want to know whether I can use <mysqli_real_escape_string> in my form validation and if so what is the link identifier should I use considering that the database base connection is already called in the first include that is generated by CMSB?

Thanks
Terry

Re: [terryally] mysqli_real_escape_string

By Dave - April 20, 2012

Hi Terry,

Do you mean PHP 5? PHP 6 hasn't been released yet, so any version out there would be very early alpha/beta and not suitable for a production environment.

Also, for compatibility we use mysql_* function not mysqli_* functions. So you can use mysql_real_escape_string() without a connection identifier and it will use the current connection. Eg: mysql_real_escape_string( $record['title'] );

And the CMSB codebase has a shorter function that we often use called mysql_escape() that does the same thing.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com