Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have developed a small CMS on my local WAMP machine.

Once I have exported my project on to the hosting, the following problem shows up

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /homepages/36/d288053636/htdocs/MYWEBSITE/admin/index.php on line 44

Warning: Cannot modify header information - headers already sent by (output started at /homepages/36/d288053636/htdocs/MYWEBSITE/admin/index.php:44) in /homepages/36/d288053636/htdocs/MYWEBSITE/admin/index.php on line 62

LINE 44:

$row = mysql_fetch_assoc(mysql_query("SELECT id,usr FROM pureUser WHERE usr='{$_POST['username']}' AND pass='".md5($_POST['password'])."'"));

Line 62:

header("Location: index.php");

What does those errors mean?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.7k views
Welcome To Ask or Share your Answers For Others

1 Answer

The SQL query has not finished correctly. You most likely uploaded the script, but have either not uploaded the database, or have wrong database credentials.

Hint You can get very good and descriptive error messages when you put the following code after a failing mysql_query statement:

if (mysql_error()) {
    die(mysql_error());
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...