--- Jake McHenry <[EMAIL PROTECTED]> wrote:
> I took the single quotes off of the field name, uname, but still
> getting the same error at the same line in the file...
> 
> Any other suggestions?

Sure.

Let's look at your original code:

$result = mysql_query("SELECT * FROM `users` WHERE `uname` =
'".$_POST['username']."'");

So, rather than trying to glance at this and figure out what's wrong, I will
instead suggest a debugging technique or two.

1. Put your query in a variable like $sql. This can simplify your statement:

$result = mysql_query($sql);

2. Don't wait until you use $result to find out it's not a valid resource; test
it immediately:

if (!$result = mysql_query($sql))

3. If it's not a valid resource, this conditional statement will be true. You
can echo (or send to a log file) the output of mysql_error() to see what MySQL
thinks the last error was (which will be the error generated by the query, in
this case).

Hope that helps.

Chris

=====
My Blog
     http://shiflett.org/
HTTP Developer's Handbook
     http://httphandbook.org/
RAMP Training Courses
     http://www.nyphp.org/ramp

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to