Jump to content
MakeWebGames

Recommended Posts

Posted

Warning: mysql_query() expects parameter 2 to be resource, null given in C:\wamp\www\authenticate.php on line 12

 

I keep getting this on wamp and xampp, any idea why it would keep giving me this error?

It's a standard authenticate.php uneditted.

Could someone help me figure this issue out?

 

global $c;
$uq=mysql_query("SELECT userid FROM users WHERE login_name='{$_POST['username']}' AND `userpass`=md5('{$_POST['password']}')",$c) or die(mysql_error());

 

That is lines 11 & 12

Posted

This is the worst option ever, and probably wrong, but hey atleast it's worth the try.

 

global $c;
$uq=mysql_query("SELECT userid FROM users WHERE login_name='{$_POST['username']}' AND `userpass`=md5('{$_POST['password']}')",$c) 
Posted

Do *not* remove the die() statement - you want to know if your script isn't working..

All you need to do is make sure that the database is installed correctly, and all data in the configuration file matches (v1: mysql.php | v2: config.php)

Posted

Yeah i checked my DB info etc. My script has this setup correctly as i use to do it in xp but ever since vista i've not been able to do the xampp or wamp systems with my game because of authenticate.php

Posted

to cure this all i did was remove this from authnticate.php

header("Location: loggedin.php");

and replaced with

echo "<script>document.location.href='loggedin.php'</script>";

echo "<script>'Content-type: application/octet-stream'</script>";

has worked fine ever since for Xammp

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...