34534534534555
IS-IT--Management
Hello,
I have the following script to print a mysql table info to a file. It prints the column titles, and then row2, row3, row4. BUT, not row1? I presume i have a counter wrong or something.... but i can't see it!
Additionally, if anyone knows a good mysql -> xls / doc tutorial, please point!
Specifically, how do i format the xls file? Bold and centre the column titles and autowidth the columns? And, my file downloads automatically when clicking on the hyperlink, how do i tell the computer to open that file once downloaded?
Thanks in advance.
I have the following script to print a mysql table info to a file. It prints the column titles, and then row2, row3, row4. BUT, not row1? I presume i have a counter wrong or something.... but i can't see it!
Code:
$condition = mysql_num_fields($result);
for ($i = 0; $i < $condition; $i++)
{
echo mysql_field_name($result, $i) . "\t";
}
print ("\t");
print ("\n");
while($row = mysql_fetch_array($result))
{
for($j = 0; $j < $condition; $j++)
{
while ($myrow = mysql_fetch_array($result))
{
$name = $myrow["name"];
$mobilenumber = $myrow["mobilenumber"];
echo $name;
print ("\t");
echo $mobilenumber;
print ("\n");
}
}
}
print "\n";
Additionally, if anyone knows a good mysql -> xls / doc tutorial, please point!
Specifically, how do i format the xls file? Bold and centre the column titles and autowidth the columns? And, my file downloads automatically when clicking on the hyperlink, how do i tell the computer to open that file once downloaded?
Thanks in advance.