diff -r ac0ca51809b1 -r 47dd15d8bb8c seq_update.php --- a/seq_update.php Wed Apr 18 22:48:49 2007 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ - trancer nl> | -// | Sjeemz sjeemz nl> | -// +--------------------------------------------------------------------+ -// -// File: seq_update.php -// Description: synches your database after manual insertions. -// Doesnt do much, just searches the highest record_id and updates the seq table with this - -require_once("inc/toolkit.inc.php"); -require_once("inc/header.inc.php"); - -// Ok we have to synch it all. -// What to do? Find the MAX(id) on each table and set it to the _seq table. - -echo "

" . _('Synching databases. This is useful if you did manual insertions (in case you havent been here yet).') . "

"; - -if(!level(10)) -{ - error(ERR_LEVEL_10); -} - -function seq_update(&$item) -{ - global $db; - $number_u = $db->getOne("SELECT MAX(id) FROM $item"); - if($number_u > 1) - { - echo $number_u; - $number_u_seq = $db->getOne("SELECT id FROM " . $item . "_seq"); - if($number_u_seq < $number_u) - { - $number_u += 1; - $db->query("UPDATE " . $item . "_seq SET id='$number_u'"); - } - } -} - -$tables = array('users', 'zones', 'records', 'domains'); - -array_walk($tables, 'seq_update'); - -message( _('All tables are successfully synchronized.') ); - -php?>