Welcome Guest, Not a member yet? Register   Sign In
[solved] Error 1064 - Database error
#1

[eluser]Bianca Migueis[/eluser]
Hi,
I am getting an error with this and can't figure out why. I am pretty sure it has something to do with the md5 code. I have the password field set up with varchar(32).

Any help would be appreciated.

Code:
public function updateDB($data)
    {
        $data['loggedin'] = $this->cookie->checkcookie();
        
        $sql = "INSERT INTO user(username, password, first_name, middle_name, last_name, email) VALUES ?, ?, ?, ?, ?, ?";
        $this->db->query($sql, array($this->input->post('username'), $this->input->post('password'), $this->input->post('first'), $this->input->post('middle'), $this->input->post('last'), $this->input->post('email')));
        
        $this->load->view('registersuccess_view', $data);
    }

error
Code:
A Database Error Occurred
Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''qazwsx', 'e10adc3949ba59abbe56e057f20f883e', 'Bianca', 'pardellas', 'Migueis', ' at line 1

INSERT INTO user(username, password, first_name, middle_name, last_name, email) VALUES 'qazwsx', 'e10adc3949ba59abbe56e057f20f883e', 'Bianca', 'pardellas', 'Migueis', '[email protected]'

Filename: C:\Users\Ted\WebDesign Portifolio\Rent\CodeIgniter_2.0.2\system\database\DB_driver.php

Line Number: 330
#2

[eluser]danmontgomery[/eluser]
Code:
$sql = "INSERT INTO user(username, password, first_name, middle_name, last_name, email) VALUES ( ?, ?, ?, ?, ?, ? )";
#3

[eluser]Bianca Migueis[/eluser]
YAY Thank you so much Smile




Theme © iAndrew 2016 - Forum software by © MyBB