count_all () or count_all_results ()? |
[eluser]domix24[/eluser]
hello, I type this in the url (localhost/codeigniter/registration/registration/) I see well the form I type words in the corresponding fields (username = domix24 pass = ******** pass2 = ******** [email protected]) (these fields of are not in the database) I confirm the form and I see these figures: 00 wants to means(false for the email and false for the username). If I put count_all () for 2, it shows me 11 well, but if I test data which are in the database (username = domix24 and email = [email protected]) (I vien to enter them with the script) I also obtain 11 and it reinsert in the database. You have an idea of which to put between count_all () (just insertions in the database) and count_all_result () (no insertion in the database)? thank you. If you do not want (or can not) download the file, consider lower in the page
[eluser]Atharva[/eluser]
You will get reply more quickly if you post your code here instead of attaching a file.
[eluser]domix24[/eluser]
registery.php Code: <?php Code: <?php Code: <html> Code: <html>
[eluser]cideveloper[/eluser]
Hello Domix Right of the bat there are some glaring problems from the code you showed here. Code: <label for="pseudo">Username </label> The label says for="pseudo" while the field has a name="user" The same issue for all your fields and labels Secondly Code: $this->form_validation->set_rules('pass1', 'Password', 'required|trim|min_length[3]|max_lenght[15]|matches[mdp2]|xss_clean'); matches[mdp2] is nothing. You are not sending mdp2 in the form. Code: $data['valid'] = $this->registery->goToSubmit($data['pseudo'], $data['email']); $data['pseudo'] is nothing. It is not set in the controller. IMPORTANT look into Callbacks instead of Code: $data['user'] = $this->registery->isValidUser($this->input->post('user')); Then you wont have to go through the process of goToSubmit Also why are you storing pass2 in the db? Its only meant to be a confirmation to make sure they typed the password correct. Also if you don't want duplicates in the db for specifi fields you should have a unique constraint on the fields.
[eluser]domix24[/eluser]
Thank you, I fix all problems and works! ;-) I did not know the trick of "callback" :bug: |
Welcome Guest, Not a member yet? Register Sign In |