$avg_pgt = mysql_query("SELECT avg(convert(custom_var_v1,unsigned)),min(convert(custom_var_v1,unsigned)), max(convert(custom_var_v1,unsigned) FROM `table_name` WHERE server_time BETWEEN '$date 00:00:00' AND '$date 23:59:59'");
$row_all = mysql_fetch_array($avg_pgt);
$string_avg = (string)$row_all[0];
echo $string_avg;
It gives an error mysql_fetch_array() expects parameter 1 to be a resource boolean given in the code
mysql_*
functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which.die(mysql_error());
.