![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
help with this error...
To make a long story short....I downloaded a php program somewhere and put it on my server to see how it works. I followed the directions on how to install it, but now when I go to the website and try to get in I get this:
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in .../control/index.php on line 48. I get 2 of those messages...one on line 48 and one on line 50. I did abbreviate the path also, not that it matters. The script should be correct, but I dont know why I'm getting that message. Any ideas on where to look or what to check? JD |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Do you have MySQL installed? Can you post the code on and surrounding line 48, in control/index.php?
|
|
|
|
|
|
#3 |
|
Programmer
|
yea MySQL is installed and working.... I know its connecting because at the beginning index.php has:
mysql_connect($db_host, $db_user, $db_pwd); mysql_select_db($db_name); It grabs those from another file. I changed my username in the other file and it wasnt able to connect, so it looks like its connecting properly. Here is the code from index.php: $res = mysql_query("select value from admin where field='login'");
$db_login = mysql_result($res, 0);
$res = mysql_query("select value from admin where field='passwd'");
$db_passwd = mysql_result($res, 0);
if ($_SESSION['asess_name'] != $db_login || $_SESSION['asess_passwd'] != md5($db_passwd)) {
echo($login_screen);
echo("<script>alert('Invalid login, please check your admin username and password.');</script>");
session_destroy();
mysql_close;
exit;That starts with line 47. So you can see 48 and 50 are getting login/pass from the database. JD |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|