Re: problems with login script
- From: morph.1989@xxxxxxxxx
- Date: Mon, 19 May 2008 05:40:46 -0700 (PDT)
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"...
.
- References:
- problems with login script
- From: morph . 1989
- Re: problems with login script
- From: "Álvaro G. Vicario"
- problems with login script
- Prev by Date: Re: PDO: Switch database user without reopening connection
- Next by Date: Re: PDO: Switch database user without reopening connection
- Previous by thread: Re: problems with login script
- Next by thread: displaying line breaks?
- Index(es):
Relevant Pages
|