Jump to content


Photo

Unknown column 'username' in 'field list'


  • Please log in to reply
16 replies to this topic

#1 CircularStopSign

CircularStopSign
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 22 August 2006 - 08:57 PM

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

#2 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 22 August 2006 - 09:01 PM

Some code would be nice.  Thanks.
What is the CoronaMatrix?

#3 CircularStopSign

CircularStopSign
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 22 August 2006 - 09:02 PM

sure, what would you like the code for?  i didn tknow if it was a general problem or not.. sorry

#4 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 22 August 2006 - 09:05 PM

The code for the mysql query would be a good start :)
What is the CoronaMatrix?

#5 HeyRay2

HeyRay2
  • Members
  • PipPipPip
  • Advanced Member
  • 223 posts

Posted 22 August 2006 - 09:09 PM

The error you received is telling you that your database query is looking for a field called username, but it does not exist in the database.

If you removed the username 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... ;)

#6 CircularStopSign

CircularStopSign
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 22 August 2006 - 09:16 PM

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

#7 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 22 August 2006 - 09:18 PM

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 :).
What is the CoronaMatrix?

#8 CircularStopSign

CircularStopSign
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 22 August 2006 - 09:22 PM

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();
}


#9 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 22 August 2006 - 09:24 PM

Hmm... the format of the code here is throwing me off.  Does it have a carriage return after:

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

If so then that's your problem :);
What is the CoronaMatrix?

#10 CircularStopSign

CircularStopSign
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 22 August 2006 - 09:28 PM

whats a carriage return?

#11 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 22 August 2006 - 09:34 PM

Does the
";
part of the code start on a newline from
echo "<strong>Your email address has already been used by another member in our database. Please use a different Email address!

What is the CoronaMatrix?

#12 HeyRay2

HeyRay2
  • Members
  • PipPipPip
  • Advanced Member
  • 223 posts

Posted 22 August 2006 - 09:35 PM

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 ( ; ), it could cause a parse error like the one you are seeing.

Make sure those lines of code look like this:

$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();
}


#13 CircularStopSign

CircularStopSign
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 22 August 2006 - 09:39 PM

yeah, that is how it looks in my code...

#14 CircularStopSign

CircularStopSign
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 22 August 2006 - 09:50 PM

i took out the first '}' because it looks unneaded? ami right?

#15 HeyRay2

HeyRay2
  • Members
  • PipPipPip
  • Advanced Member
  • 223 posts

Posted 22 August 2006 - 09:59 PM

If you are intending to include join_form.html when a duplicate email address is detected, then you are correct in removing that first }.

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

#16 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 22 August 2006 - 10:00 PM

i took out the first '}' because it looks unneaded? ami right?


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).

#17 CircularStopSign

CircularStopSign
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 22 August 2006 - 10:04 PM

alright, thank you guys... now i just have to get rid of all the things i didnt want :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users