JamesFinch Posted September 27, 2012 Share Posted September 27, 2012 Hi I'm hoping someone can help me with an old PHP 3 script which used to work fine but now bombs since my ISP upgraded us to a new server with PHP 5.3. The script (see attached) is supposed to query a MYSQL database table called observations and display the output. Would be grateful if anyone could tell me why it's not working and how to correct it. Thanks. James results-date-1.php Link to comment https://forums.phpfreaks.com/topic/268840-script-works-in-php-3x-but-not-in-php-5x/ Share on other sites More sharing options...
requinix Posted September 27, 2012 Share Posted September 27, 2012 Pfft-- Are you surprised it doesn't work? PHP 3 is one month away from being 12 years old. It's even older than Windows XP and that's been around forever. At 6.26 KB it shouldn't take long to rewrite it for 5.3. Long-form globals like $HTTP_POST_VARS are now just $_POST, function signatures have changed quite a bit (mostly by adding options, but some have been changed), and there's support for classes and objects. And that only gets you up to 5.2: after that a bunch of things became deprecated (magic_quotes, register_globals, assorted functions and extensions). Check the changelogs to find out more - the above is just some of the more important changes in a nutshell. Link to comment https://forums.phpfreaks.com/topic/268840-script-works-in-php-3x-but-not-in-php-5x/#findComment-1381235 Share on other sites More sharing options...
ManiacDan Posted September 27, 2012 Share Posted September 27, 2012 You have bugs in this code that would have thrown errors 12 years ago had you turned error-reporting on. Put this at the top of your script: error_reporting(E_ALL); Then start from the top and fix every warning and error. You also have blocks in here which are unnecessary, like your switch to determine the month of the year. wren_functions.php probably has more problems. You should also tell strangers what "bombs out" means, since we're not sitting next to you able to actually read the errors that you can see. Link to comment https://forums.phpfreaks.com/topic/268840-script-works-in-php-3x-but-not-in-php-5x/#findComment-1381291 Share on other sites More sharing options...
JamesFinch Posted September 28, 2012 Author Share Posted September 28, 2012 Thanks for your help ManiacDan and requinix. Link to comment https://forums.phpfreaks.com/topic/268840-script-works-in-php-3x-but-not-in-php-5x/#findComment-1381489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.