I'm trying to write some queries to export MySQL information to a file,
and I'm a bit of a newbie. I'm querying the database for fieldnames,
and then field data. then I want to write the data to a file in a sort
of key:value format:
[fieldname]:[field data]
for example...
SKUID:AF332
NAME:Jesus Poster
PRICE:12.95
(etc...)
I have the fieldnames in an array called @fieldlist...
-------
$describe_products = "describe $products";
# execute the describe query
$sth = $dbh->prepare("$describe_products");
$sth->execute();
# get the fieldnames and push them into an array
while (@fields = $sth->fetchrow_array()) {
my $field = $fields[0];
push(@fieldlist,$field);
}
--------
and I guess I can do a second query to select the data, but I am stuck
at how to write them out in sort of key-value pairs. and i'm not even
sure this is the most efficient way.
any help appreciated!
thanks,
rory
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]