Hi Guys,
I have my data going into an excel spreadsheet, just needt o know how to get the next field in the next column in excel, they're all coming up in the same one at the moment.
<?
header ("Content-type: application/csv\nContent-Disposition: \"inline; filename=yourfilename.csv\"");
$connection = mysql_connect($dbhost, $dbusername, $dbpass);
$SelectedDB = mysql_select_db($dbname);
$query = "SELECT * FROM signup WHERE uname='$username'";
$results = mysql_query($query, $connection);
while ($inquiryrow = mysql_fetch_array($results)) {
$email = $inquiryrow["email"];
$companyname = $inquiryrow["compname"];
$address1 = $inquiryrow["address1"];
}
$result = mysql_query($query) or die("Query failed : " . mysql_error());
echo "'Site,Building,Floor'\r\n"; //header
while($row = mysql_fetch_row($result)){
echo "'$email','$companyname','$address1'\r\n"; //data
//echo "\"$email\",\"$companyname\",\"$address1\"\r\n"; //data
}
?>
Hope someone can help, I know that \r\n puts in a new row, not sure how to get stuff in a new column though.
Thanks for looking!