< ?php
$link = mysql_connect('50.62.209.50:3306', 'aarekhmunnu', 'DKaarekh9009@42351');
if (!$link)
{
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';

mysql_select_db("aarekh", $link);

$result = mysql_query("SELECT * FROM book");

$fans=$_POST['txtfans'];

$hours=$_POST['txthours'];

while($row=mysql_fetch_array($result))
{
echo "Name:".$row["name"]."";
echo "author :".$row["author"]."";

$watts=$row['watts'];

$total=$fans*$hours*$watts;

}

?>

enter no. of fans

enter daily hours

Watts

Total daily consumption