Solarpitch Posted December 17, 2008 Share Posted December 17, 2008 Hey, I generally set up a page called "database.php" which has all my database functions. When I started to write a new application this morning, I set one up but noting was being called from the database.php file. So I stripped everything down to this basic example and I still cant get it to work <?php //### database.php function get_select(){ $select = "Test"; return $select; } //### test.php include("database/database.php"); echo get_select(); ?> The page will just crash as soon as it hits the get_select() function. You can see how basic this is and it still wont retrieve from the database file. I tried to put error_reporting(E_ALL); but noting happens. Quote Link to comment https://forums.phpfreaks.com/topic/137350-solved-strange-issue-with-functions/ Share on other sites More sharing options...
RichardRotterdam Posted December 17, 2008 Share Posted December 17, 2008 If that is the code that makes the script crash on some sort of way then it must be the database/database.php script ther is nothing wrong with the function Quote Link to comment https://forums.phpfreaks.com/topic/137350-solved-strange-issue-with-functions/#findComment-717614 Share on other sites More sharing options...
Solarpitch Posted December 17, 2008 Author Share Posted December 17, 2008 I know, the code seems perfect but at the moment... thats the only function I have in the database.php file! No other code could be breaking this apart from what you see there. I dont even thinks it's something stupid at this stage because I's of well noticed it by now Quote Link to comment https://forums.phpfreaks.com/topic/137350-solved-strange-issue-with-functions/#findComment-717617 Share on other sites More sharing options...
asmith Posted December 17, 2008 Share Posted December 17, 2008 What do you mean by "crashes"? Browser closes? it gives error? be more clear please. Quote Link to comment https://forums.phpfreaks.com/topic/137350-solved-strange-issue-with-functions/#findComment-717618 Share on other sites More sharing options...
Solarpitch Posted December 17, 2008 Author Share Posted December 17, 2008 Sorry asmith... what I mean by that is, anything after the function will not display. The page will simply get to the function and stop executing. For example... <?php echo "Step 1"; echo get_select(); echo "Step 2"; ?> If I do this, Step 1 will print to screen but it wont get to Step 2 Quote Link to comment https://forums.phpfreaks.com/topic/137350-solved-strange-issue-with-functions/#findComment-717620 Share on other sites More sharing options...
asmith Posted December 17, 2008 Share Posted December 17, 2008 does it prints the "Test" on the page too? If not, If you remove the echo get_select(); , it will print "Step 2" ? If you remove include("database/database.php"); will you get Step 1 Test Step2 ? Quote Link to comment https://forums.phpfreaks.com/topic/137350-solved-strange-issue-with-functions/#findComment-717624 Share on other sites More sharing options...
Solarpitch Posted December 17, 2008 Author Share Posted December 17, 2008 I just got off the phone to my host. Problem was, there was a change made on the .htaccess file yesterday so we could manage directory paths the way we wanted with a framework we are using. I asked them to remove the rule and now the functions are working again. Weird tho, not sure why that would have had an effect on my functions. PHP can be a mystery sometimes ... thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/137350-solved-strange-issue-with-functions/#findComment-717627 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.