Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 21st, 2006, 11:25 AM   #1
JDStud6
Programmer
 
Join Date: Jan 2005
Location: Charleston, SC www.wareonearth.com
Posts: 57
Rep Power: 4 JDStud6 is on a distinguished road
Send a message via AIM to JDStud6
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
JDStud6 is offline   Reply With Quote
Old Feb 21st, 2006, 12:12 PM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Do you have MySQL installed? Can you post the code on and surrounding line 48, in control/index.php?
Arevos is offline   Reply With Quote
Old Feb 21st, 2006, 12:21 PM   #3
JDStud6
Programmer
 
Join Date: Jan 2005
Location: Charleston, SC www.wareonearth.com
Posts: 57
Rep Power: 4 JDStud6 is on a distinguished road
Send a message via AIM to JDStud6
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
JDStud6 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:25 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC