I want to show the number of sales/buys a sales person has done. I have a search box which when I type in their name it should bring back a number . So to count total buys I am using this code:
<?php
mysql_connect ("****", "****","****") or die (mysql_error());
mysql_select_db ("*******");
$term = $_POST['term'];
$sql = mysql_query("select count(*) from car_orders where side='buy' and sales_id like '%$term%'");
while ($row = mysql_fetch_array($sql)){
echo 'owner_id: '.$row['sales_id'];
echo '<br/> side '.$row['side'];
echo '<br/><br/>';
}
?>
I have tried finding out how to just get the count figure to show on the page and have failed. Please could somebody help