Page 1 of 1

Re: php signup form with image upload

Posted: Fri Jul 10, 2015 3:45 pm
by Celauran
Can you post the entire file? The line numbers in the errors don't make any sense given the code you've posted.

Re: php signup form with image upload

Posted: Fri Jul 10, 2015 4:50 pm
by Celauran
What does redirect_to do? If it's a header redirect, it's going to fail because headers have already been sent when you echoed "File uploaded.. etc"

Re: php signup form with image upload

Posted: Fri Jul 10, 2015 5:01 pm
by Celauran
MySQL error no 1062 : Duplicate entry 'ianhaney' for key 'username'
That's pretty straightforward: there's already a user with that username in the DB. That's because you're executing the same query twice

Code: Select all

                                $result = $mysqli->query($sql);

if ($mysqli->query($sql)) {

Re: php signup form with image upload

Posted: Fri Jul 10, 2015 5:11 pm
by Celauran
UNIQUE was probably a better choice, and I've explained why you're seeing it twice.