KDawg08 Posted January 20, 2010 Posted January 20, 2010 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 Quote
Redex Posted January 20, 2010 Posted January 20, 2010 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) Quote
KDawg08 Posted January 20, 2010 Author Posted January 20, 2010 well my friend has the same version (v1) and doesn't have this issue... we have wamp and xampp both and both are setup EXACTLY the same... Quote
Magictallguy Posted January 21, 2010 Posted January 21, 2010 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) Quote
KDawg08 Posted January 21, 2010 Author Posted January 21, 2010 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 Quote
Uridium Posted January 23, 2010 Posted January 23, 2010 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.