I had my connection to the database in several files, so I decided to make an include that just had this:
<?
mysql_connect (localhost, "blahblah", "blahblah");
mysql_select_db ("blahblah");
?>
I have a calendar page that has the include statement pointing to (../includes/dbconnect.php) and that seems to work. It pulls the data and gives no errors. But if I go to another page in the very same directory, I get the Warning: Supplied argument is not a valid MySQL result resource error.
I tried it both by going to a file relative path like
include("../includes/dbconnect.php");
and also a full path like
include("http://www.madeofclay.com/am/includes/dbconnect.php");
.
It works on one page, but not the other. However, if I take the code out of the inlcude, and put it right into the file itself, everything works as it should.
Anyone have an idea what might cause this?
I can't seem to get a variable that is defined in an include to have any value in the main file either. Its not being defined inside a function either. Wierd stuff, but I'll start with the first thing, first.
I appreciate any help.