JackTheRussel
Programmer
Hi all.
I run sql-query (select time, values from table)
and I get this kind of results:
My old program used to use fetctrow_array() function
and it worked fine.
Here I get sql-results and print them into file:
BUT. Now I use functions to get results from database and I
"can't" use fetchrow_fuction() anymore.
How can I print data into file in same way, when not using
fetchrow_array() function ?
I run sql-query (select time, values from table)
and I get this kind of results:
Code:
| time | value |
+---------------------+-------+
| 2006-12-15 08:51:16 | 14502 |
| 2006-12-15 08:53:43 | 14542 |
| 2006-12-15 08:59:02 | 14678 |
My old program used to use fetctrow_array() function
and it worked fine.
Here I get sql-results and print them into file:
Code:
my $sth = $db_connection->prepare($sql_clause);
$sth->execute();
while(@results=$sth->fetchrow_array()){
open (SESAME, ">>$filename");
print SESAME "$results[0] $results[1]\n";
}
close SESAME;
BUT. Now I use functions to get results from database and I
"can't" use fetchrow_fuction() anymore.
Code:
my @results = &function_select($sql_clause);
How can I print data into file in same way, when not using
fetchrow_array() function ?