mysql error help please
Posted by: 7Kyle7 (---.woh.res.rr.com)
Date: April 04, 2006 05:11PM

This is the error I am getting while using wamp:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in path\authenticate.php on line 136


Here is the line of code that is giving the error:

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


if (mysql_num_rows($uq)==0) is line 136

if anyone can tell me what the problem is it would be very much appreciated. thanks in advance.



Post Edited (04-04-06 17:14)

Options: ReplyQuote
Re: mysql error help please
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: April 04, 2006 08:38PM

Before you can run your mysql query, you need to make a connection to the the mysql server first, then select the database to use.

$dblink = mysql_connect ( 'localhost', 'usr', 'pass');
mysql_select_db ('database', $dblink);

Options: ReplyQuote
Re: mysql error help please
Posted by: 7Kyle7 (---.woh.res.rr.com)
Date: April 06, 2006 01:28AM

thanks a bunch. I had a mysql file but i just forgot to add a part in it. thanks though, it works now

Options: ReplyQuote


Sorry, only registered users may post in this forum.