thedigicraft / Atom.CMS

Atom.CMS
56 stars 52 forks source link

Developing a Dynamic Website 2014 - Part 61 - Inserting Records and Adding Email Field #65

Open Polyhistor opened 10 years ago

Polyhistor commented 10 years ago

The "Auto Complete" Function totally doesn't work for my google chrome, and it keep having the email and the password no matter what!, plus I get the error when I try to save the new user, the error is this: User Could Not Be Added Because:Column count doesn't match value count at row 1 Query: INSERT INTO users (first, last, email, password) VALUES ('puya', 'ataei', 'mercury@mercury.com', SHA1('soro'), '0')

iboutsikas commented 10 years ago

You are inserting into 4 columns, 5 different values. you are either missing a value after password, or you have added the extra '0' somehow after SHA1('soro'),

Polyhistor commented 10 years ago

Yes, You were right. that '0' belonged to the status that I "somehow" forgot to add to my query. Thank you.

siddiquedu commented 9 years ago

Can You please solve my problem? seems entry is fine but not added to users. here is the error: Query:INSERT INTO users (firstname, lastname, email, password, status) VALUES ('babu', 'mia', 'siddiquedu@gmail.com', md5('123456'), '0')

code was $q = "INSERT INTO users (firstname, lastname, email, password, status) VALUES ('$firstname', '$lastname', '$_POST[email]', md5('$_POST[password]'), '$_POST[status]')"; [it added succesfully when there was no email option in the form. but now not added after email option added to form.]

paulrusan commented 9 years ago

so what's the correct code for this issue?

creptor commented 9 years ago

that query is correct :c maybe you haven't defined one of the colums in the users table (check the table name). md5 hash is week. use sha2 or better (sha1 also is better than md5)

thedigicraft commented 9 years ago

@siddiquedu

can you toss a debug line in there...

echo mysqli_error($dbc).'<br> query: '.$q;
ishangote commented 7 years ago

@thedigicraft Update Query working fine. Insert inserts twice in the database

creptor commented 7 years ago

@ishangote Please create a new issue with your hole code, so I can more easily identify the problem.

If you use pastebin it would be even better.