Beginner, needs some help |
[eluser]kjanko[/eluser]
Using CodeIgniter framework for the first time, and experiencing the first issues with it. This is an account registration module, however the only data that's insert inside the database is 0 in all columns. Full code won't be shown. view: Code: <form action="http://delisium.com/register/make" method="post"> controller: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); model: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Any help appriciated.
[eluser]OliverHR[/eluser]
Hello Kjanco, Code: if($this->session->userdata('loggedin')) 1 - That throws you an error because you cannot send output before using redirect check in docs: http://ellislab.com/codeigniter/user-gui...elper.html 2 - Is redirect not rederict And for data debug use: Code: log_message('debug', print_r($data, true)); // For the array in your insert. Hope this help you. Full solution won’t be posted.
[eluser]kjanko[/eluser]
if($this->session->userdata('loggedin')) is always false since I don't have an account that I can use for login however I corrected those mistakes. Next, $data = array( 'user' => $username, 'pass' => $sha_pass, 'mail' => $email, 'agee' => $age ); $this->user->MakeAccount($data['user'], $data['pass'], $data['mail'], $data['agee']); log_message('debug', print_r($data, true)); This is what I did to the make method. However nothing is printed when I access it.
[eluser]osci[/eluser]
try Code: if($query->num_rows() > 0)
[eluser]osci[/eluser]
I thought it might be a cast problem. I'm not sure about the < maybe you could use == 0 instead of <= 0
[eluser]kjanko[/eluser]
I think there's a problem with retrieving the post data, which might be the reason why nothing is inserted in the db.
[eluser]kjanko[/eluser]
I feel like bumping this as I can't solve it. EDIT: So simple, yet annoying. I forgot to name my input fields /request closed thread.
[eluser]InsiteFX[/eluser]
Change this for one! Code: // from this: InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |