rmd Posted March 13, 2008 Share Posted March 13, 2008 Hello all! My hosting provider recently upgraded to php5 and one of my php scripts is playing up. I have looked all over the php site for an idea of what part of the code needs changing and have drawn a blank. If anyone has any idea of what needs altering in the below code to get it working on php5, I would be very grateful. PHP Code: if (($_GET["sub"] == "auto") && (($_GET["action"] == "add") || ($_GET["action"] == "edit"))) { $_models = $that->db->QFetchRowArray("SELECT * FROM {$that->tables[make]}"); if (is_array($_models)) { foreach ($_models as $key => $val) { if ($val["make_parent"] == 0) { $make[$val["make_id"]] = $val["make_name"]; $js .= "models[{$val[make_id]}] = new Array();\n"; $i = 1; $js .= "models[{$val[make_id]}][" . $i++ ."] = new Option(\"[ select ]\" , \"\"); \n"; foreach ($_models as $k => $v) { if ($v["make_parent"] == $val["make_id"]) { $js .= "models[{$val[make_id]}][" . $i++ ."] = new Option(\"{$v[make_name]}\" , \"{$v[make_id]}\"); \n"; } } } } } $extra["add"]["after"] = $extra["edit"]["after"] = $that->templates["js"]->Replace(array("script" => $js )); } if (($_GET["sub"] == "auto") && ($_GET["action"] == "details")) { $task = new CSQLAdmin("photos", $_CONF["forms"]["admintemplate"],$that->db,$that->tables , $extra); $extra["details"]["after"] .= $task->DoEvents(); Many thanks Link to comment https://forums.phpfreaks.com/topic/95933-having-trouble-getting-php4-code-to-work-on-php5-server/ Share on other sites More sharing options...
lordfrikk Posted March 13, 2008 Share Posted March 13, 2008 Does it show any errors? It should if it's not working. Link to comment https://forums.phpfreaks.com/topic/95933-having-trouble-getting-php4-code-to-work-on-php5-server/#findComment-491120 Share on other sites More sharing options...
rmd Posted March 13, 2008 Author Share Posted March 13, 2008 Hi Lordfrikk, It does not show any errors, but it's not locating a mysql query. This only happened since the server migrated from php4 to php5 Link to comment https://forums.phpfreaks.com/topic/95933-having-trouble-getting-php4-code-to-work-on-php5-server/#findComment-491123 Share on other sites More sharing options...
lordfrikk Posted March 14, 2008 Share Posted March 14, 2008 If I'm not mistaken you are using this http://scripts.ringsworld.com/financial-tools/property-management-software/lib/database.php.html as a database abstraction layer. It's really hard to say why it isn't working without giving an error of any sort, but my guess is that the problem is in the abstraction layer. You might want to try different one and see if it works. Link to comment https://forums.phpfreaks.com/topic/95933-having-trouble-getting-php4-code-to-work-on-php5-server/#findComment-492028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.