supplied argument is not a valid MySQL result resource

前端 未结 4 1183
心在旅途
心在旅途 2020-12-04 04:12

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

Warn

4条回答
  •  余生分开走
    2020-12-04 04:57

    The first error means means that you're calling mysql_fetch_assoc() on something that isn't a MySQL resource. mysql_query is supposed to return a proper resource, so if you're getting this error it probably means that your query failed (something is probably configured wrong).

    Due to the way HTTP works, it's impossible to send HTTP headers (such as the Location header) after you've started writing the body of the page. When the first error occurred, it wrote an error message to the body, causing another error when you tried to send the headers to redirect the user. This should go away ince you've fixed your first bug.

提交回复
热议问题