PDA

View Full Version : Warning: mysql_fetch_assoc


JaxAce
12-25-2010, 04:32 AM
I'm getting problems from the start and I feel like searching the web for something else. I've installed scripts before but this one will drive you insane to figure out. Not enough instructions. Has anyone else had this error below? Dictionary is the folder everything is in but I'm getting the below error.






---------
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in public_html/dictionary/admin.php on line 237

James
12-25-2010, 05:24 AM
you have the database information correct and it is setup right?

JaxAce
12-25-2010, 05:33 AM
I've been checking my DB over and over. I also compare it to other database programs like the Shoutbox.php. I'm using. Maybe I need to load a SQL script in MY phpadmin and create table. What table...I don't know.


---------
DEFINE ("DB_HOST", 'localhost');
DEFINE ("DB_USER", 'anonymous');
DEFINE ("DB_PWD", 'anonymous');
DEFINE ("DB_NAME", 'anonymous');

JaxAce
12-25-2010, 03:04 PM
Content visible to registered users only.
---------

function CheckForm() {
$res = mysql_query("SELECT `name` FROM `admin` WHERE `name`= '".addslashes($_POST['user'])."' AND `password`= '".md5($_POST['pass'])."' LIMIT 1;");
if (!mysql_fetch_assoc($res))
//if ((ADMIN_USER != $_POST['user']) || (ADMIN_PASS != $_POST['pass']))
$GLOBALS['error'] = 'Invalid login';
else {
$_SESSION['user'] = $_POST['user'];
$_SESSION['pass'] = $_POST['pass'];
Redirect('admin.php');
}
--------
on line 237: if (!mysql_fetch_assoc($res))