Jump to content
Larry Ullman's Book Forums

Problems With Chapter 18 Example


Recommended Posts

Hi cracking book by the way, learned loads.

 

I get an error when I try and register (Chapter 18), the error is:

 

An error occurred in the script f:\sites\register.php on line 63 query: Insert into users email, pass, first_name, last_name etc etc

 

It then states :

 

MYSQL Error : Unknown column 'first_name' in 'field list'

 

I know the SQL database has this field name correctly spelled the same as the PHP.

 

Help, spent ages looking?

 

GY

 

 

Link to comment
Share on other sites

Some of the error is given below, the only difference is the order, but that should not matter. the actual code is exactly as the download from Larrys site.

 

The database is set up using the code from the book, and appears correct.

 

 

 

An error occurred in script 'F:\Sites\register.php' on line 63: Query: INSERT INTO users (email, pass, first_name, last_name, active, registration_date) VALUES ('1@2.com', SHA1('zzzzzzzz'), 'xx', 'yy', '38f7125efa20dccb8da938bd95cdda1e', NOW() )

 

MySQL Error: Unknown column 'first_name' in 'field list'

Date/Time: 10-30-2014 16:18:05

Array

(

[_GET] => Array

(

)

 

[_POST] => Array

(

[first_name] => xx

[last_name] => yy

=> 1@2.com

[password1] => zzzzzzzzzzz

[password2] => zzzzzzzzzzz

[submit] => Register

)

Link to comment
Share on other sites

What happens when you execute the following query directly on the DB?

 

INSERT INTO users 
(email, pass, first_name, last_name, active, registration_date) 
VALUES 
('1@2.com', SHA1('zzzzzzzz'), 'xx', 'yy', '38f7125efa20dccb8da938bd95cdda1e', NOW());
 
Also, is user_level a required field?
Link to comment
Share on other sites

 Share

×
×
  • Create New...