Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
:(( How to save file as a csv file,extrated data from mysql database
Posted
Updated 11-Jan-10 21:45pm
v2

Following pseudo-code is essentially you need to do
#Make connection
$Connection = DBI->connect(server, username, password);

#Create empty csv file
open(MyFile, ">test.csv");

#Make a query
$QueryString = qq{select * from database-table};
$Query = $Connection->prepare($QueryString);

$Query->execute();

while(@Array = $Query->fetchrow_array())
{
   print MyFile, $Array[0], $Array[1];
}
 
Share this answer
 
v3
Scratch all of that. You're using PHP, and Perl ?
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900