Open Polyhistor opened 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'),
Yes, You were right. that '0' belonged to the status that I "somehow" forgot to add to my query. Thank you.
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.]
so what's the correct code for this issue?
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)
@siddiquedu
can you toss a debug line in there...
echo mysqli_error($dbc).'<br> query: '.$q;
@thedigicraft Update Query working fine. Insert inserts twice in the database
@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.
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')