Hi, I am trying to understand why I can't do this (or why I get errors when doing it):
I have a class extended Base
inside the class I have a function
inside the function I have a query
because this query is repeated several times in several functions inside the class, in an attempt to slim down the class file, I decided to take the part of the mysql query that is the same for all queries and stick it inside an inc file.
I did that and called it query.inc
then inside the functions I removed the first part of the query (the one that is the same for every function) and replace it with:
include('query.inc');
From there on in the functions I left the rest of the query (that changes in every function) like this:
sql .= "rest of query here...";
The script appears to work fine but I get errors like these at the top of the page:
Warning: open_basedir restriction in effect. File is in wrong directory in /home/virtual/site372/fst/var/www/html/reviews/lib/class_reviews.inc on line 276
Warning: open_basedir restriction in effect. File is in wrong directory in /home/virtual/site372/fst/var/www/html/reviews/lib/class_reviews.inc on line 276
Now I know I can add a @ and make them go away but I'd like to know why I am getting them and if it is bad practice to do what I did with the include... I just wanted to slim down the class_reviews.inc file...
I had also tried to put the first part of the query in a function and then call the function within the functions but that didn't work either...
What is wrong about this inc thing?