Page 3 of 3
Posted: Fri Jan 13, 2006 6:40 am
by Bill H
I moved
calendar.php out of the calendar subdirectory and up into the root.
PROBLEM SOLVED.
Code: Select all
SELECT * FROM eh_event WHERE Date='2006-01-06'
Executes properly and returns the row with that date.
So there is some setting on this server that doesn't allow queries to be called from within subdirectories.
All PHP functionality involving MySQL queries must be located in the root. Is that wierd or what?
I am so pleased to find out that it's my host that's being obtuse, deliberately or otherwise, and not me.
Posted: Fri Jan 13, 2006 9:16 am
by timvw
If you prepend the following to your scripts you will probably see that php failed to include the file (the problem is usely because different settings for include_path).
Code: Select all
ini_set('error_reporting', 'E_ALL ^ (E_RECOVERABLE_ERROR | E_WARNING | E_NOTICE)');
ini_set('display_errors', TRUE);
Posted: Fri Jan 13, 2006 9:49 am
by Bill H
No, that was one of the things that I checked carefully. It was including the file. I spent a total of 14 hours adding error messages in every location in the world. I actually considered the location of calendar.php since it was the only script not working and the only one located in a subdirectory, but moving it made no sense. Why would access to a db be limited to scripts in the root directory?
The include file was (and still is) in the subdirectory, but when included by a file in the root (include "calendar/db_connect.php") the connection was made successfully. When included by a file in the subdirectory (include "db_connect.php") the connection was made (no errors), but it did not execute the query. When I moved the script to the root and changed the include to (include "calendar/db_connect.php") that solved the problem.
With calendar.php in a subdirectory - failure, with calendar.php in the root - success. Nothing else changed other than the path of the include statement in calendar.php.
I can only conclude that this server (which is quite strange in several other ways) limits access to the db to the root directory. The client chose this host, I did not. I am working with a partner on this job, and if it were up to me I would tell the client to get a different host or get a different programmer.
Posted: Fri Jan 13, 2006 11:31 am
by RobertGonzalez
That is strange. How would the DB server know that for ONLY THAT query to not run it when it is in the sub-directory? This is a far off guess, I know, but during your testing did you clear your browser cache to make sure you were using the most recent file available?
I am wondering if you put it back in the subdirectory if it might work now.
Posted: Fri Jan 13, 2006 4:39 pm
by Bill H
I cannot hazard a guess, but I confess to being less than expert on server technology. I know a little, but it is by no means my forte. I don't think it's a matter of running the query, I think it has to do with connectivity.
Your point about the browser cache is well made: I have been caught by that more than once, but such was not the case this time. (My favorite trick is to alter a script and then start testing and be unable to figure out why my changes did not take effect. Oops, forgot to upload it.)
I'm on the same wavelength as you, too. Already put it back into the subdirectory. Failed. Put it back into the root and its functionality was restored again.
This whole suite of scripts has been developed on my parther's host and on mine. Works identically (and without error) on both sites. As soon as he uploaded it to the client's host not only did this calendar fail, but half a dozen other features are failing as well, style sheets not loading for instance. This host is an unbelievable mess -- allows one db and two emails, and the client is paying about three times what I pay for unlimited db's and emails. And there's the thing about db user permissions.
I'm considering seeing if the San Diego Schools has an opening for a bus driver.
Posted: Fri Jan 13, 2006 4:52 pm
by RobertGonzalez
Dude, nows the time to offer your hosting services to this client. If you don't offer hosting services, go become a reseller and sell them a package. The host they are using seems to be immeasurable shady and they should be cast off like the smelly pig-dogs that they are. Whoa, sugar high's do wierd things to a man...
Anyway, I'm glad to hear that things are working. From a logical perspective, nothing that happened to you in this case makes any sense at all. But I am happy for you.
Posted: Fri Jan 13, 2006 5:33 pm
by Bill H
I resell to four of my clients (and two others are transferring to me shortly), but this one isn't even my client. I'm the sub to a friend of mine in North Carolina, and his client is in Florida. They just hauled off and signed up with this schlock and then contacted my friend and said, "Okay we're ready for our website, here's our host." They told him they are getting a really "good deal" with this host because they signed up for two domains.
And, actually, things still aren't working. The calendar is, but there are still several other things that are inexplicably broken.
Shortly after I put the site up for a new client of mine a few months ago on the host that he had contracted with I went to make a small change and the site had disappeared in its entirety. I thought maybe he had some sort of problem with it so I called and asked if he had taken it down. Nope, he was as mystified as I was. So I contacted the host. Yes, they said, their server had crashed and they do not maintain any backups. What? No, they are working on something that will provide that some day in the future and it won't cost the customer anything, but they suggest that the customers should maintain backups on their local drives. No backups. At all. When he transfers to me his site will be backed up against server crashes and what I'm charging him will be less than he is paying now.
The Internet is an amazing place.
Posted: Fri Jan 13, 2006 6:03 pm
by RobertGonzalez
Amazing how crappy some companies can be and how shady some service providers can be. With the abundance of inexpensive, service filled internet services nowadays I can only assume the client didn't do their homework. A shame really, but a wonderful opportunity for you to shine.