PHP Classes

I like this class concept as it offers great flexibility over...

Recommend this page to a friend!

      Synchronize DB  >  All threads  >  I like this class concept as it...  >  (Un) Subscribe thread alerts  
Subject:I like this class concept as it...
Summary:Package rating comment
Messages:2
Author:Alex Saavedra
Date:2008-09-05 14:10:57
Update:2008-09-06 08:41:45
 

Alex Saavedra rated this package as follows:

Utility: Good
Consistency: Insufficient
Examples: Sufficient

  1. I like this class concept as it...   Reply   Report abuse  
Picture of Alex Saavedra Alex Saavedra - 2008-09-05 14:10:57
I like this class concept as it offers great flexibility over which tables from your master DB you want to replicate in separate slave DBs. So I tried this class just out of the box, modifying a couple of lines in the provided "exemple.php" corresponding to DB credentials, and used sample data from some production database. To my surprise the INSERT statements failed as soon as single quotes were found in some VARCHAR fields.

I suggest you add some escaping functions prior to sending INSERTs in order for this class to work in the real world. You may use addslashes() or even better, mysql_real_escape_string(), yet even better, rely on some proved database abstraction layer (there are lots out there).

A. Saavedra

  2. Re: I like this class concept as it...   Reply   Report abuse  
Picture of Cristian Vrinceanu Cristian Vrinceanu - 2008-09-06 08:41:45 - In reply to message 1 from Alex Saavedra
Thank you for your feedback.
I updated the class source file so that it escapes special characters of sql parameters.
Your input is always welcome.

Cristian Vrinceanu