Hi, i was wondering if anyone could help me export a table that i have created to a tab delimited csv file...
Code example of my Query and print:
[PHP]mysql_connect($ server, $db_user, $db_pass)
or die ("Database CONNECT Error");
$result = mysql_db_query( $database, "SELECT sum(payment) as payments, email, sales.refid FROM sales,affiliate s WHERE sales.refid=aff iliates.refid group by email")
or die ("Database Error");
if (mysql_num_rows ($result))
{
print "<font face=arial><TAB LE border=1 cellspacing=0 cellpadding=3 align=center>";
print "<TR><TH>Pa yPal Account</TH><TH>Payment</TH><TH>Type</TH>";
print "<TH>Referr er</TH>";
print "<TH>Messag e</TH></TR>";
while($info = mysql_fetch_arr ay( $result ))
{
print "<TR>";
print "<TD><font size=2>";
print $info['email'];
print "</TD>";
print "<TD><font size=2>";
print $info['payments'];
print "</TD>";
print "<TD><font size=2>";
print "AUD";
print "</TD>";
print "<TD><font size=2>";
print $info['refid'];
print "</TD>";
print "<TD><font size=2>";
print "VicPay Commission Statement";
print "</TD>";
print "</TR>";
}
print "</table>";
} [/PHP]
Now that i have displayed the table correctly in PHP i have no idea how to export it...
is there a way i can have save button or hyperlink to download the file??
thanks
FallingReign
Code example of my Query and print:
[PHP]mysql_connect($ server, $db_user, $db_pass)
or die ("Database CONNECT Error");
$result = mysql_db_query( $database, "SELECT sum(payment) as payments, email, sales.refid FROM sales,affiliate s WHERE sales.refid=aff iliates.refid group by email")
or die ("Database Error");
if (mysql_num_rows ($result))
{
print "<font face=arial><TAB LE border=1 cellspacing=0 cellpadding=3 align=center>";
print "<TR><TH>Pa yPal Account</TH><TH>Payment</TH><TH>Type</TH>";
print "<TH>Referr er</TH>";
print "<TH>Messag e</TH></TR>";
while($info = mysql_fetch_arr ay( $result ))
{
print "<TR>";
print "<TD><font size=2>";
print $info['email'];
print "</TD>";
print "<TD><font size=2>";
print $info['payments'];
print "</TD>";
print "<TD><font size=2>";
print "AUD";
print "</TD>";
print "<TD><font size=2>";
print $info['refid'];
print "</TD>";
print "<TD><font size=2>";
print "VicPay Commission Statement";
print "</TD>";
print "</TR>";
}
print "</table>";
} [/PHP]
Now that i have displayed the table correctly in PHP i have no idea how to export it...
is there a way i can have save button or hyperlink to download the file??
thanks
FallingReign
Comment