Jump to content

Not a valid MySQL Resource Link?


maxudaskin

Recommended Posts

I get this error:

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/.grable/vzoom/virtualzoom.net/include/functions.php on line 10

 

For this script:

 

dbconnect.php

<?php
$hostname_LeadHost = "localhost";
$database_LeadHost = "dbname";
$username_LeadHost = "dbuser";
$password_LeadHost = "dbpass";
$con = mysql_pconnect($hostname_LeadHost, $username_LeadHost, $password_LeadHost) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db('dbname', $con);
?>

 

functions.php

require ("dbconnect.php");

function login($username,$password){
$md5pass = md5($password);
$sql = "SELECT * FROM users WHERE pid = '{$username}'";
$sql2 = "SELECT * FROM users WHERE pass = '{$md5pass}'";
$query = mysql_query($con,$sql);
$query2 = mysql_query($con,$sql2);
if (!$query || (mysql_numrows($result) < 1)){
return 1;
}
elseif(!$query2 || (mysql_numrows($result2) < 1)){
return 2;
}
else
{
return 0;
}
}

Link to comment
https://forums.phpfreaks.com/topic/60433-not-a-valid-mysql-resource-link/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.