rmd
03-13-2008, 10:55 AM
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.
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 (($_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