Jump to content

Having trouble getting php4 code to work on php5 server


rmd

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.