PHP Classes

bug in insert section

Recommend this page to a friend!

      LMSQL  >  All threads  >  bug in insert section  >  (Un) Subscribe thread alerts  
Subject:bug in insert section
Summary:bug in insert section
Messages:4
Author:Maxamuud Xuseen
Date:2020-04-18 04:27:51
 

  1. bug in insert section   Reply   Report abuse  
Picture of Maxamuud Xuseen Maxamuud Xuseen - 2020-04-18 04:27:51
welcome
I thank you from the bottom of my heart for the great work.
you have done to facilitate the way to connect the mysql database through pdo.
But I suspect that there is some error in the way to add new records.
Through my review of the code, I found the error correct.
Please clarify, if there is anything wrong with my words.

  2. Re: bug in insert section   Reply   Report abuse  
Picture of Arash Soleimani Arash Soleimani - 2020-04-18 11:08:50 - In reply to message 1 from Maxamuud Xuseen
Thank you Maxamuud,

You were right. I fixed the bug and add two example files.

  3. Re: bug in insert section   Reply   Report abuse  
Picture of Maxamuud Xuseen Maxamuud Xuseen - 2020-04-19 06:21:18 - In reply to message 2 from Arash Soleimani
Thanks for your quick response to solving the problem.
And I really see this class more than wonderful.
And I will be working on a chapter review for my students in Somalia.
For the alert in the update code, the update does not work completely in the array, but we need to work for each field in the database with its own row of code.
As in the example:

not working:
$mysql->update(['table' => 'users' , 'where'=>['us_id' => 1] , 'values'=> [
'us_name' => 'Hindas',
'us_adress' => 'somalias',
'us_active' =>'2'
] ]);


working:
$mysql->update(['table'=>'users', 'where'=>['us_id'=>1], 'values'=>['us_name'=>'Hinda']]);
$mysql->update(['table'=>'users', 'where'=>['us_id'=>1], 'values'=>['us_adress'=>'somalia']]);
$mysql->update(['table'=>'users', 'where'=>['us_id'=>1], 'values'=>['us_active'=>'2']]);


_________________________________________________________
As you can see, there is difficulty in repeating such a procedure at a table with large fields

_________________________________________________________

And to know that I really liked this class

  4. Re: bug in insert section   Reply   Report abuse  
Picture of Arash Soleimani Arash Soleimani - 2020-04-30 08:46:20 - In reply to message 3 from Maxamuud Xuseen
Thank you Maxamuud,
Sorry for the delay. I fixed the update method and example file.

If you find any problem or need new functions, let me know.