<div>
<div class="rich_girls"><div>
<div class="girls_rich_a">
<div class="tits_rish_a1" id="tits_click_a1"></div>
</div>
</div>
<?
$arr = [];
$query = $mysqli->query("SELECT sum,id FROM history WHERE id2='1'");
while ($set = $query->fetch_array()) {
$arr[$set['id']] = $set['sum'];
$array = $arr[$set['id']];
}
?>
<script>
var myArr = ['.implode(",",<?=$array;?>).']
var buyers = document.getElementById('buyers').getContext('2d');
var buyerData = {
labels : ["1","2","3","4","5"],
datasets : [
{
fillColor : "rgba(172,194,132,0.4)",
strokeColor : "#ACC26D",
pointColor : "#fff",
pointStrokeColor : "#9DB86D",
data: myArr
}
]
}
</script>
for ($index = 1; $index < 11; $index++) {
$upzn = $mysqli->query("UPDATE akcii SET price2 = price1, price1 = price1 + {$ar[$index]} WHERE id = {$ar[$index]} LIMIT 1");
echo $ar[$index];
}
$ar = [];
$query = $mysqli->query("SELECT nom, price FROM kurs_bufer");
while ($row = $query->fetch_array()) {
$ar[$row['nom']] = $row['price'];
}
for ($index = 1; $index < 11; $index++) {
$upzn = $mysqli->query("UPDATE akcii SET price2 = price1, price1 = price1 + '$ar[$index]' WHERE id = $ar[$index] LIMIT 1");
}