2006-01-11, 11:19 PM
Hello all,
I am going to create some preset reports for my admins to run on the users of our site.
Basically I believe I am able to create a link that will run an sql-query that I define on the database....however I don't necessarily want to show the results on a formatted page, but rather pipe it to csv-file....now how would I do it?
So there would be for example a link that runs the following:
SELECT mybb_users.uid, mybb_userfields_firstname, mybb_userfields_lastname, mybb_userfields_street1, mybb_userfields_street2, mybb_userfields_street3, mybb_userfields_city, mybb_userfields_postcode, mybb_country_countryname
FROM mybb_users, mybb_userfields, mybb_country
WHERE mybb_users.hardcopyapproval='YES' AND (mybb_users.uid=mybb_userfields.ufid) AND (mybb_users.countryid=mybb_countryid) AND mybb_users.addressquality='MAILABLE';
(quite obviously a query to pull mailing-labels for a hardcopy-mailing)
this would then need to pop-up a 'file save -dialogue' with a CSV-file with proper encoding to protect the international characters...
can anyone help me?
cheers,
Kimmo
I am going to create some preset reports for my admins to run on the users of our site.
Basically I believe I am able to create a link that will run an sql-query that I define on the database....however I don't necessarily want to show the results on a formatted page, but rather pipe it to csv-file....now how would I do it?
So there would be for example a link that runs the following:
SELECT mybb_users.uid, mybb_userfields_firstname, mybb_userfields_lastname, mybb_userfields_street1, mybb_userfields_street2, mybb_userfields_street3, mybb_userfields_city, mybb_userfields_postcode, mybb_country_countryname
FROM mybb_users, mybb_userfields, mybb_country
WHERE mybb_users.hardcopyapproval='YES' AND (mybb_users.uid=mybb_userfields.ufid) AND (mybb_users.countryid=mybb_countryid) AND mybb_users.addressquality='MAILABLE';
(quite obviously a query to pull mailing-labels for a hardcopy-mailing)
this would then need to pop-up a 'file save -dialogue' with a CSV-file with proper encoding to protect the international characters...
can anyone help me?
cheers,
Kimmo