Re: problems with login script



On May 19, 2:13 pm, "Álvaro G. Vicario"
<alvaroNOSPAMTHA...@xxxxxxxxxxxxxx> wrote:
morph.1...@xxxxxxxxx escribió:

Hi, I can't get this script to work.
I've used this exact script on other places and it works, but now i
get this error.

<code> Warning: mysql_fetch_array(): supplied argument is not a valid
MySQL result resource in C:\xampp\htdocs\uploads\login_script.php on
line 15 </code>

I can't see what is wrong.

Speaking in plain English, this error message means that you can't fetch
rows from $res because the database query failed. So you need to check
whether the query fails or not:

$res = mysql_query($sqlfraga, $dbconnect);

if(!$res){
// Error: log it, abort or whatever
echo 'Query failed: ' . mysql_error();

}else{
// Read rows
}

I also recommend you to enable full error reporting (at least in your
dev box). Edit your php.ini file or add this to the top of the script:

ini_set('display_errors', 1);
error_reporting(E_ALL);

--
--http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:http://bits.demogracia.com
-- Mi web de humor al baño María:http://www.demogracia.com
--

tanks for the help all of you guys.. the escaping being wrong i was
already aware of, i was in a bit of hurry when i set them up and i saw
that it was wrong just after posting this...
anyways the problem was that i named the table administrators in the
database and i wrote administrator in the querry, so all i really
needed was an "s"...
.



Relevant Pages

  • Re: problems with login script
    ... I've used this exact script on other places and it works, ... this error message means that you can't fetch rows from $res because the database query failed. ...
    (comp.lang.php)
  • Re: problems with login script
    ... I've used this exact script on other places and it works, ... If you still have the same problem, echo $sqlfraga & mysql_errorto the screen and check what's wrong with the query. ...
    (comp.lang.php)
  • Re: problems with login script
    ... I've used this exact script on other places and it works, ... Rik Wasmus ...
    (comp.lang.php)
  • Re: problems with login script
    ... I've used this exact script on other places and it works, ... Then fail to check whether $res is FALSE, which could be the case if there was an issue with rights to the database. ...
    (comp.lang.php)