- Timestamp:
- Mar 17, 2013, 3:55:39 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/include/evntcats_admin_funcs.inc.php
r10457 r21652 79 79 $page['errors'][] = 80 80 sprintf(l10n('ec_DB_problem'), $n). 81 'MySQL error '. mysql_errno().', "'.mysql_error().'"';81 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 82 82 return false; 83 83 } … … 137 137 $t2 = 0; $t3 = false; $t4 = false; 138 138 while ( // The check is executed once at minimum 139 !($t3 = mysql_fetch_row(pwg_query("139 !($t3 = pwg_db_fetch_row(pwg_query(" 140 140 SELECT `id` 141 141 FROM `".GROUPS_TABLE."` … … 154 154 $page['errors'][] = 155 155 sprintf(l10n('ec_group_create_pb'), $_POST['groupname']).' (1) : '. 156 'MySQL error '. mysql_errno().', "'.mysql_error().'"';156 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 157 157 if ( 158 158 pwg_query(" … … 162 162 ) $page['errors'][] = 163 163 sprintf(l10n('ec_group_create_pb'), $_POST['groupname']).' (2) : '. 164 'MySQL error '. mysql_errno().', "'.mysql_error().'"';164 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 165 165 else $page['infos'][] = sprintf( 166 166 l10n('ec_group_create_OK2'), … … 176 176 array_key_exists($_POST['ec_in_up_cat'], $ec_lists['categories']) 177 177 ) { 178 if ( mysql_num_rows(pwg_query("178 if (pwg_db_num_rows(pwg_query(" 179 179 SELECT `id` 180 180 FROM `".CATEGORIES_TABLE."` … … 197 197 ); 198 198 mass_inserts(GROUP_ACCESS_TABLE,array('group_id','cat_id'), $inserts); 199 if ( mysql_errno() == 0)199 if (pwg_db_errno() == 0) 200 200 $page['infos'][] = sprintf( 201 201 l10n('ec_group_create_OK2'), … … 206 206 l10n('ec_assoc_pb'), 207 207 $_POST['groupname'],$ec_lists['categories'][$_POST['ec_in_up_cat']] 208 ).' : MySQL error '. mysql_errno().', "'.mysql_error().'"';208 ).' : MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 209 209 } 210 210 } … … 241 241 l10n('ec_assoc_pb'), 242 242 $_POST['groupname'],$ec_lists['add_pages'][$_POST['ec_in_up_aps']] 243 ).' : MySQL error '. mysql_errno().', "'.mysql_error().'"';243 ).' : MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 244 244 else $page['infos'][] = sprintf( 245 245 l10n('ec_group_create_OK2'), … … 274 274 AND `user_id` = '$ec_user_id'; 275 275 "); 276 while ($row = mysql_fetch_array($result))276 while ($row = pwg_db_fetch_assoc($result)) 277 277 $granteds[$row['cat_id']][] = $row['user_id']; 278 278 $inserts = array(); … … 285 285 if (count($inserts) != 0) { 286 286 mass_inserts(USER_ACCESS_TABLE, array('user_id','cat_id'), $inserts); 287 if ( mysql_errno() == 0)287 if (pwg_db_errno() == 0) 288 288 $page['infos'][] = sprintf( 289 289 l10n('ec_group_create_OK2'), … … 294 294 l10n('ec_assoc_pb'), 295 295 $_POST['login'], $ec_lists['categories'][$_POST['ec_in_up_cat']] 296 ).' : MySQL error '. mysql_errno().', "'.mysql_error().'"';296 ).' : MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 297 297 } 298 298 } … … 553 553 $arg2p = ($arg2 == 'NULL') ? 'IS NULL' : ' = '.$arg2; 554 554 $ec_user_idp = ($ec_user_id == 'NULL') ? 'IS NULL' : ' = '.$ec_user_id; 555 if (($t1 = mysql_fetch_row(pwg_query("555 $r = pwg_query(" 556 556 SELECT `id` 557 557 FROM `".EVNTCATS_TABLE."` … … 563 563 AND `forced` = '".$forced."' 564 564 AND `comment` = '".$comment."' 565 "))) !== false) { // print("<pre>$arg1 $arg2<br>$q</pre>"); 565 "); 566 if (pwg_db_num_rows($r)) { // print("<pre>$arg1 $arg2<br>$q</pre>"); 567 $t1 = pwg_db_fetch_row(); 566 568 $page['errors'][] = sprintf(l10n('ec_entry_already_exists'), $t1[0]); 567 569 return false; … … 570 572 // Delete other entries using the same code, if needed 571 573 if ($del_other) { 572 if ((573 $t1 = mysql_fetch_row(pwg_query("574 SELECT `code`575 FROM `".EVNTCATS_TABLE."`576 WHERE `id` = ".$_POST['ec_entry_sel']577 ))) === false578 ) die('Entry not found in DB ?!');574 $r = pwg_query(" 575 SELECT `code` 576 FROM `".EVNTCATS_TABLE."` 577 WHERE `id` = ".$_POST['ec_entry_sel'] 578 ); 579 if (!pwg_db_num_rows($r)) die('Entry not found in DB ?!'); 580 $t1 = pwg_db_fetch_row($r); 579 581 $r = pwg_query(" 580 582 SELECT `id` … … 583 585 AND `id` <> ".$_POST['ec_entry_sel'] 584 586 ); 585 while ($t2 = mysql_fetch_row($r)) if (!ec_delete_entry_OK($t2[0]))587 while ($t2 = pwg_db_fetch_row($r)) if (!ec_delete_entry_OK($t2[0])) 586 588 return false; 587 589 } … … 608 610 $page['errors'][] = 609 611 l10n('ec_entry_create_pb').' : '. 610 'MySQL error '. mysql_errno().', "'.mysql_error().'"'612 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"' 611 613 ; 612 614 $ret = false; … … 616 618 $forced = ($forced == 'false') ? '' : l10n('ec_cnfrm_forced'); 617 619 $page['infos'][] = 618 sprintf(l10n('ec_entry_create_OK'), mysql_insert_id()).620 sprintf(l10n('ec_entry_create_OK'), pwg_db_insert_id()). 619 621 $ec_code.' => '. 620 622 $ec_lists['user_ids'][$ec_user_id].$forced … … 639 641 $page['errors'][] = 640 642 l10n('ec_entry_create_pb').' : '. 641 'MySQL error '. mysql_errno().', "'.mysql_error().'"'643 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"' 642 644 ; 643 645 $ret = false; … … 662 664 function ec_delete_entry_OK($ec_id) { 663 665 global $page; 664 if (count($t = mysql_fetch_row(pwg_query("666 $r = pwg_query(" 665 667 SELECT `code` 666 668 FROM `".EVNTCATS_TABLE."` 667 669 WHERE `id` = $ec_id; 668 "))) == 0) { 670 "); 671 if (!pwg_db_num_rows($r)) { 669 672 $page['errors'][] = sprintf(l10n('ec_entry_dont_exist'), $ec_id); 670 673 return false; 671 674 } 675 $t = pwg_db_fetch_row($r); 672 676 if (pwg_query(" 673 677 DELETE FROM `".EVNTCATS_TABLE."` … … 677 681 sprintf(l10n('ec_entry_del_nok'), 678 682 $ec_id). 679 'MySQL error '. mysql_errno().', "'.mysql_error().'"';683 'MySQL error '.pwg_db_errno().', "'.pwg_db_error().'"'; 680 684 return false; 681 685 }
Note: See TracChangeset
for help on using the changeset viewer.