Jump to content
Larry Ullman's Book Forums

Error When Viewing Index.Php


Recommended Posts

The path to mysql.inc.php is incorrect and index.php can't include it. You need to double check the location and path to the mysql.inc.php file.

 

Also, I'd recommend you post code/error messages as text and not as images, it's much easier for people to check that way.

Link to comment
Share on other sites

Thanks for the reply Rob,

 

In my config.inc i have:

 

define ('BASE_URI', '/site2/');

define ('BASE_URL', 'www.spafusion.co.uk');

define ('MYSQL', BASE_URI . 'mysql.inc.php');

 

and mysql.inc.php is stored in

 

home/lewyh/public_html/site2/

 

or

 

www.spafusion.co.uk/site2

 

 

i have uploaded the site so it will be www.spafusion.co.uk/site2/html.

 

all the shop.php, index.php etc is in the folder html and the mysql.inc.php is up 1 directory in /site2

 

sorry if it is confusing i am not very good at explaining in plain english.

Link to comment
Share on other sites

i am now getting:

 

An error occurred in script '/home/lewyh/public_html/site2/html/views/home.html' on line 14:

mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given

 

does this mean the conenction to database is right now but theres somethnig else wrong?

 

Can anyone help please?

Link to comment
Share on other sites

So first, don't EVER post a message like "anybody? i need help". You need to be patient and obviously people would help if and when they can. Second, don't post a link to an image behind a protected directory that forces an authentication window to appear every time this page is loaded. Third, if you had read the forum guidelines yet, you'd notice that you still have posted the most basic information, like the versions in use. Fourth, if you want help, don't just dump pages and pages of data like you just did. That makes it HARDER to help, not easier. And, of course, it's wasting space in my database and bandwidth on my server.

 

Finally, as for your problem, this is a very common and standard error that's caused by the query not returning any results. You have to apply the standard PHP-MySQL debugging techniques to determine why.

Link to comment
Share on other sites

usually when you get the error

mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given

it means that your database query wasn't succesful for any number of reasons. If you look through the above output carefully you'll see that it gives you some clues to identifying your error - in this case you have an undefined category in noproducts.html on line 11. so check the script which calls noproducts.html.

 

It can often be helpful to run your queries directly in mysql to see if they're working / why they're not working - you'll (usually) get a helpful error message if something is wrong.

 

If you get a chance read the chapter on Error Handling and Debugging in Larry's book, "PHP and MySQL for Dynamic Websites". It will save you a lot of time in the future.

Link to comment
Share on other sites

 Share

×
×
  • Create New...