[svn r11822] Added checks before issuing SQL query

skala
Yannick Warnier 18 years ago
parent a4d9f5acd3
commit e65a393d59
  1. 4
      main/install/update-db-scorm-1.6.x-1.8.0.inc.php

@ -185,12 +185,16 @@ foreach($courses_id_full_table_prefix_list as $course_code => $db)
if($old_parent_chap != 0){
$new_chap = $lp_chap_items[$old_chap];
$new_parent = $lp_chap_items[$old_parent_chap];
if(isset($new_chap) && $new_chap != ''
&& isset($new_parent) && $new_parent != '')
{
$sql_par_chap = "UPDATE $my_new_lp_item " .
"SET parent_item_id = $new_parent " .
"WHERE id = $new_chap";
$res_par_chap = api_sql_query($sql_par_chap,__FILE__,__LINE__);
}
}
}
unset($parent_chaps);
//Now one loop to set the next_item_id and the previous_item_id
foreach($ordered_chaps as $parent_chap){

Loading…
Cancel
Save