Welcome Guest, Not a member yet? Register   Sign In
Active Record "insert" is not working properly
#11

[eluser]appleboy[/eluser]
Opera and Chrome are working now, so IE can't work?

You can try the following model code:

controller:
Code:
<?php
public function process()
{
        $this->load->helper('security');
        $username = $this->input->post("username");
        $passwd = do_hash($this->input->post("password"));
        $email = $this->input->post("email");    
        $data = array(
            "username" => $username,
            "passwd" => $passwd,
            "email" => $email,
        );
        $this->load->model('members');
        $this->members->register($data);  
        $this->data['title'] = "Registration done!";
        $this->data['msg'] = "A private key of your account has been sent to your email address. Please, enter it in below form to confirm your account.";
            $this->template->render($this->data);
}
?>

Model
Code:
<?php
class Members extends CI_Model {
    public function register($data){
        $this->db->insert('mytable', $data);  
    }
}
?>
#12

[eluser]NeoArc[/eluser]
I think it's a navigator problem.
Show the complete javascript code please.
#13

[eluser]Daksh Mehta[/eluser]
the above code is full one.
Ill try new model tomorrow and update the thread.

thanks all!
#14

[eluser]NeoArc[/eluser]
Hmm, how do you invoke the Register::process() method? Using Ajax / form request?
#15

[eluser]Daksh Mehta[/eluser]
Thank you all.

No, i am invoking the process() normally through CI url structure.
ie. http://localhost/app/index.php/register/process
#16

[eluser]waynhall[/eluser]
So, to clarify...

It works fine in Opera and Chrome, but not in IE? or Firefox?
#17

[eluser]Daksh Mehta[/eluser]
only in FF is not working...

Sad
#18

[eluser]waynhall[/eluser]
Is it not working when Firebug is closed, or only when it is open?
#19

[eluser]Daksh Mehta[/eluser]
its same even if i turn off each and every addon!
#20

[eluser]waynhall[/eluser]
Although this shouldn't be necessary in a well-written program, this workaround may solve your issue for now:

Code:
<?php
class Members extends CI_Model {
    
    public function register($username, $password, $email){
        
        if($username && $password && $email) {  // check if they exist and aren't 0 or FALSE
            // you could also try:
            // if(!empty($username) && !empty($password) && !empty($email)){}
            
            $sqlq = "INSERT INTO members VALUES(?, ?, ?, ?)";
            $this->db->query($sqlq, array(NULL, $username, $password, $email));  
        }
          
    }
}




Theme © iAndrew 2016 - Forum software by © MyBB