<?php require_once('../connection.php');


$stmt = $GLOBALS['master']->prepare("SELECT * FROM `dd_plant`")or die(mysqli_error("getItems: ".$GLOBALS['master']));
$stmt->execute();$rslt=$stmt->get_result();
$c=1;
while($i=mysqli_fetch_array($rslt)){
$stmt2 = $GLOBALS['master']->prepare("UPDATE `dd_plant` SET `id`='".$c."' WHERE `code`='".$i['code']."'")or die($e=mysqli_error($GLOBALS['master']));
$stmt2->execute();
$c++;
}


$stmt = $GLOBALS['master']->prepare("SELECT * FROM `dd_phrases`")or die(mysqli_error("getItems: ".$GLOBALS['con']));
$stmt->execute();$rslt=$stmt->get_result();
$c=1;
while($i=mysqli_fetch_array($rslt)){
$stmt2 = $GLOBALS['master']->prepare("UPDATE `dd_phrases` SET `id`='".$c."' WHERE `phrasecode`='".$i['phrasecode']."'")or die($e=mysqli_error($GLOBALS['master']));
$stmt2->execute();
$c++;
}




