Jump to content


Photo

Need Help with, 'not a valid MySQL-Link resource'


  • Please log in to reply
2 replies to this topic

#1 drranch

drranch
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 23 July 2006 - 01:16 AM

::) I need another pair of eyes, since I can't see what is wrong with this statement...

Error message:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\inetpub\vhosts\test.com\httpdocs\authenticate.inc on line 15

Here is the code:
  // Formulate the SQL find the user
  $query = mysql_query("SELECT password FROM users WHERE username = '{$loginUsername}'
            AND password = '{$password_digest}' AND activated >'0'", $connection);


#2 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 23 July 2006 - 01:26 AM

it meant your $connection is bad.  The query is good, but check how you connect to database.
Life's too short for arguing.

#3 drranch

drranch
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 23 July 2006 - 03:43 PM

;D  Found it....

The order of my function authenticateUser data was set incorrectly.

Original call function design:
function authenticateUser($loginUsername, $loginPassword, $connection)

On page processing data:
>:( bad function; bad >:(
authenticateUser($connection, $_SESSION["loginUsername"], $oldPassword))

corrected bad function:
authenticateUser($_SESSION["loginUsername"], $oldPassword, $connection))

thanks for pointing me in the right direction ;D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users