Jump to content

Archived

This topic is now archived and is closed to further replies.

CircularStopSign

Unknown column 'username' in 'field list'

Recommended Posts

what does this mean, i was working with the Membership System code from PHPfreaks.com and i took out the username so i can just use the email address to login. When you enter your information to signup, this comes up after...?

thanks,
    pat

Share this post


Link to post
Share on other sites
The error you received is telling you that your database query is looking for a field called [b]username[/b], but it does not exist in the database.

If you removed the [b]username[/b] field from the database, then you need to remove any references to it in your queries.

A snippet of the query code and a description of your database tables would be a good start to figuring out your issue... ;)

Share this post


Link to post
Share on other sites
yeah i saw that in another post, i forgot to take out the 'username' under the check for existing user...

now i am getting this error

Parse error: parse error in /home/www/patall8.100webspace.net/register.php on line 54

Share this post


Link to post
Share on other sites
parse errors are kind of vague.  Copy that line and the code around it (about 3 lines up and 3 lines down) and we can help you :).

Share this post


Link to post
Share on other sites
oh yeah haha sorry.. i meant to line 54 being "include 'join_form.."

$email_check = mysql_num_rows($sql_email_check);

    if($email_check > 0){
        echo "<strong>Your email address has already been used by another member in our database. Please use a different Email address!<br />";
        unset($email_address);
    }
    include 'join_form.html';
    exit();
}

Share this post


Link to post
Share on other sites
Hmm... the format of the code here is throwing me off.  Does it have a carriage return after:

[code]echo "<strong>Your email address has already been used by another member in our database. Please use a different Email address![/code]

If so then that's your problem :);

Share this post


Link to post
Share on other sites
Does the [code]";[/code] part of the code start on a newline from [code]echo "<strong>Your email address has already been used by another member in our database. Please use a different Email address![/code]

Share this post


Link to post
Share on other sites
A carriage return is creating a new line with the "Return" or "Enter" key. If you have a carriage return at the end of a line of code before the line terminator ( [b];[/b] ), it could cause a parse error like the one you are seeing.

Make sure those lines of code look like this:

[code]
$email_check = mysql_num_rows($sql_email_check);

    if($email_check > 0){
        echo "<strong>Your email address has already been used by another member in our database. Please use a different Email address!";
        unset($email_address);
    }
    include 'join_form.html';
    exit();
}[/code]

Share this post


Link to post
Share on other sites
If you are intending to include [b]join_form.html[/b] when a duplicate email address is detected, then you are correct in removing that first [b]}[/b].

Otherwise, the [b]}[/b] at the end of the code you posted would need to be removed if it did not have an accompanying [b]{[/b] higher up in your code, such as the start of an [b]if()[/b] statement.

Share this post


Link to post
Share on other sites
[quote]i took out the first '}' because it looks unneaded? ami right?[/quote]

No, but you dont have a matching { to go with your last }. You'll need to post a little more code ( a few lines above what you have).

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.