How to export these data in csv file can any one modify this to get in csv file

<?php
$username = “root”;
$password = “”;
$hostname = “localhost”;
$ctr=0;//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die(“Unable to connect to MySQL”);
//echo “Connected to MySQL<br>”;

//select a database to work with
$selected = mysql_select_db(“mysql”,$dbhandle)
or die(“Could not select databse indianh3_jml1”);
$data = (mysql_query("select jos_vm_product.product_name, jos_vm_product.product_s_desc, jos_vm_product_price.product_price, concat(‘http://www.indianhairmanufacturer.com/components/com_virtuemart/shop_image/product/’,product_full_image) as product_fimage from jos_vm_product, jos_vm_product_price WHERE jos_vm_product_price.product_id = jos_vm_product.product_id order by product_parent_id,jos_vm_product.product_id ")) or die(mysql_error());
$info = mysql_fetch_array( $data );
?>
<table border=1>
<tr>
<td>title</td>
<td>descriptions</td>
<td>image1</td>
<td>Price</td>
</tr>
<?php
while($info = mysql_fetch_array( $data ))
{
echo “<tr><td>”;
Print $info[‘product_name’];
echo “</td><td>”;
Print $info[‘product_s_desc’];
echo “</td><td>”;
Print $info[‘product_fimage’];
echo “</td><td>”;
Print $info[‘product_price’];
echo “</td></tr>”;
}
Print “</table>”;
mysql_close($dbhandle);
?>

Some helpful links …