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

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.