Skip to content
Permalink
8c5f4bbdea
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
19 lines (14 sloc) 827 Bytes
<?php
if (isset($username = $_SESSION['username'])) {
$req = mysqli_query($var,"SELECT users.id, users.username,users.daily_consumption,users.monthly_consumption,users.weekly_consumption, valve.water_flow FROM users INNER JOIN valve ON users.id = valve.v_id");
while($dnn = mysqli_fetch_array($req))
{
$weekly_consumption = $dnn['weekly_consumption'];
$consumption = $dnn['monthly_consumption'];
$dailyUsage = $dnn['water_flow'];
}
$weekly_consumption = $weekly_consumption + $dailyUsage;
$monthly_consumption = $consumption + $dailyUsage;
$updateData = mysqli_query($var,"UPDATE users SET username, daily_consumtion=$dailyUsage, monthly_consumption = $monthly_consumption, weekly_consumption=$weekly_consumption");
}
?>