Jump to content
Killersites Forums

mysql Error in PHP


Recommended Posts

I have looked around for a solution for about the last 2 hours but I haven't had any luck. This is the error I am getting:



Warning: mysqli::prepare() [mysqli.prepare]: (42S22/1054): Unknown column 'email' in 'field list' in /home/content/41/6344941/html/php/login/register.php on line 88


Fatal error: Call to a member function bind_param() on a non-object in /home/content/41/6344941/html/php/login/register.php on line 89


Error 2 definitely is tied to the first error so that isn't a big deal. I am actually working on the Login Script training videos right now. I am on part 11 (retrieve lost password). Anyway at the end of the video when I go to load my script this is my error. I also loaded in the downloadable files from Ben and I get the same error so it has to be something other than the code I think. Any help would be great! Thanks =).

Link to comment
Share on other sites

So the line that is having the issue is this line?


$check = $mysqli->prepare("SELECT email FROM members WHERE email = ?");

(line 93)


You said it was an issue with line 88, but I'm not seeing anything that should cause an issue there.


I'm not sure why you are including the database include twice though (though I don't think it has anything to do with your error). On line 91, you have "include('includes/database.php');" yet you have already included that file on line 11. There shouldn't be any need to include the file twice.


I've tested this code, and I'm not having any issues. My guess is it has to be something to do with the database. Have you double checked the spelling of the column in the database? If you used "Email" or "e-mail" that may cause issues when you are trying to target a column called "email".

Link to comment
Share on other sites

Yea I added that extra include in there for testing and a few extra lines- I didn't mean to send that to you that's why the line error was off. I just went in and completely recreated the members table and it works fine. Seems really weird lol. Sorry to waste your time I should have tried something like that first it was just a really odd issue I have never heard of recreating a table to fix something like that.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...