<?php
	require('Connections/EASWARI.php');
?>
<html>

<body> 
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
//include('qrcodefile/qrlib.php');	
	

mysql_select_db($database);
	$select = 'SELECT id,category FROM book ';			
    $rs1 = mysql_query($select, $easwari) or die(mysql_error());
    while($row=mysql_fetch_assoc($rs1))
{
//echo $row['category'];
$selCat='SELECT id FROM category WHERE name="'.$row['category'].'"';
$rs2 = mysql_query($selCat, $easwari) or die(mysql_error());
$row2=mysql_fetch_assoc($rs2);
echo $update='UPDATE book SET category_id="'.$row2["id"].'" WHERE id="'.$row["id"].'"'; 
echo '<br />';
$rs3 = mysql_query($update, $easwari) or die(mysql_error());
}
	//$row = mysql_fetch_assoc($rs1);
	//echo 'http://'. $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
?>

</body> 
</html>
