![]() |
Beginner, needs some help - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Beginner, needs some help (/showthread.php?tid=42342) |
Beginner, needs some help - El Forum - 06-04-2011 [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. Beginner, needs some help - El Forum - 06-04-2011 [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-guide/helpers/url_helper.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. ![]() Beginner, needs some help - El Forum - 06-04-2011 [eluser]kjanko[/eluser] if($this->session->userdata('loggedin')) is always false since I don't have an account that I can use for login ![]() 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. Beginner, needs some help - El Forum - 06-04-2011 [eluser]osci[/eluser] try Code: if($query->num_rows() > 0) Beginner, needs some help - El Forum - 06-04-2011 [eluser]kjanko[/eluser] Osci, isn't it the same ? -.-' Beginner, needs some help - El Forum - 06-04-2011 [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 Beginner, needs some help - El Forum - 06-04-2011 [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. Beginner, needs some help - El Forum - 06-05-2011 [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. Beginner, needs some help - El Forum - 06-05-2011 [eluser]InsiteFX[/eluser] Change this for one! Code: // from this: InsiteFX |