mihai-vlc / master-login-system

An advanced login system build upon bootstrap with lots of features built in.
128 stars 94 forks source link

Update the SafeMySQL class #11

Closed dalai-lamia closed 9 years ago

dalai-lamia commented 9 years ago

Hello, This is a great system but it uses an early version of the SafeMySQL class, which has been updated several times since June 2013. Do you have the time to update the mysql.class.php file included in your system? Thanks!

dalai-lamia commented 9 years ago

I have tried to identify your edits to the class and transfer them to the updated safemysql.class.php. Initially, I was getting an error but it turned out that I had missed the two changes to getOne() and getRow(). After I transferred those as well, everything is working error-free.

The edits I have identified and transferred to the new version of safemysql.class.php are as follows:

  1. public $asObj; --- line 74
  2. 'asObj' => true, --- line 87
  3. $this->asObj = $opt['asObj']; --- line 99
  4. The whole public function ret($value) --- lines 137-146
  5. The change in public function getOne() --- line 217: return $this->ret(reset($row));
  6. The change in public function getRow() --- line 242: return $this->ret($ret);
  7. The changes you've made to private function prepareQuery($args) --- lines 495-566.

But it would be great if you can update your own mysql.class.php file for other users of your system.

mihai-vlc commented 9 years ago

Hi, Do you have any problems with the current version of safemysql ? This is not a project I currently work on but I am happy to accept a pull request with those changes.

dalai-lamia commented 9 years ago

No, not really. Just thought it a good idea to update. I mean, if the developer of the SafeMySQL class has found it necessary to improve his code, then he is aware of potential issues. And since it has taken me - a non-expert - about 30 minutes to update, I suppose it will take you much less. But the decision is yours. Cheers!

mihai-vlc commented 9 years ago

I had a look over the changes. Apart from the option to pass an existing mysqli instance there were no other major changes (or bug fixes). So I think we are good with the current version.