Hey everyone,

I have just uploaded my php files onto a free hosting server and tried to access the website. I got this error " mysql_fetch_array() expects a resource in parameter 1" or something like that. By the way, the files did work on my local machine.

What is the problem? and how do I go about fixing it?

Recommended Answers

All 4 Replies

That is usually the error message when your query has failed. Add error checking.

Thanks for that.

die(mysql_error() ); helps a lot with debugging things.

You will change your while loop condition with the following and test again.

$data = $result->fetch()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.