The method above the manual is
$up->create ();
$up->add (); Then you don't have to write the sub-paragraph by yourself.
But if I have only two values in my form, but there are 4 fields in the database, how does this method know that the two values of my form are inserted into those two fields?
My form notation
{$note}
The way I'm using it right now
$data [' aname ']=$_post[' user ']; $data [' Apwd ']=md5 ($_post[' pwd '); $data [' Bak ']=$_post[' pwd '];if ($_post[' user ']== ') ') {$this->error (' Please enter username '); exit ();} if ($_post[' pwd ']== ') {$this->error (' Password not entered, please check carefully '); exit (); $count = $upadmin->add ($data);
My database has 4 fields, the value of the form is only two, one is the user name, one is the password, insert the database has three values, one is the user name, one is encrypted MD5, one is not encrypted.
If you use automatic, how to insert, if you want to use an array, one by one to write, it is not the same, it is not automatic, such as a form has 100+ values to insert the database, it is not very troublesome.
Now my goal is to use an automatic method to insert into the database.
Reply to discussion (solution)
This is the database field.
Oh, you only see the Simple $up->create (); A bit
But didn't see the preparatory work.
Oh, you only see the Simple $up->create (); A bit
But didn't see the preparatory work.
Yes, I get it, thanks.