Someone can help me with this code.
Give this error:
Warning: mysql_fetch_array () expects parameter 1 to be resource, boolean given in /var/www/xxx/teste.php on line 14
Notice: Undefined variable: status in /var/www/santa/teste2.php on line 23
include "mysql.php";
$ped_venda_id = 13;
$sql = mysql_query ("SELECT pvi.ped_venda_id, IF(pvi.volume_restante ==0, 'T', IF(pvi.volume_total == pvi.volume_restante, 'N', 'P')) as 'status' FROM ped_vendas_item.pvi WHERE ped_venda_id = '$ped_venda_id' ");
while($r = mysql_fetch_array($sql)){
$status = $r['status'];
}
echo $status;