php - How to process data extracted through mysql statements separately
PHPz
PHPz 2017-05-16 12:58:53
0
1
366

You can get the data after mysql execution through the following code in html

$sql = "SELECT MAX(yj), AVG(yj), Min(yj) FROM " . $this->get_table('item') . ' where category_id = ' . intval($category_id);
<?php 
$biuuu = $this->avgprice;
$pr = (implode('',$biuuu));
$prr = floor($pr);
echo $prr;
?>

Results in 1136922

How to divide the results like this

The maximum value is 113, the average is 69, and the minimum value is 22

PHPz
PHPz

学习是最好的投资!

reply all(1)
给我你的怀抱

First change the sql

SELECT MAX(yj) as m_max, AVG(yj) as m_avg, Min(yj) as m_min FROM " . $this->get_table('item') . ' where category_id = ' . intval($category_id);
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template