I am trying to make a tab delimited file of a mysql table so I can open
it with Excel.
I select the data - 40 fields, 808 records no prob.
I view a mysql_num_rows() query to make sure it selects all records; no prob.

I create a tab delimited format:
$result = mysql_query("SELECT * FROM $database");
$rows=mysql_num_rows($result);
        while ($row = mysql_fetch_array($result) )
        {
        $field1="$row[field1]";
        $field2="$row[field2]";  //etc....
        
        $html.="$field1 $field2 $field3....."
        }

Then I write it to a file:
        if (! ($myfile=fopen ("tables", "w")))  {echo "file could not be opened";}
        fputs ($myfile, "$html");
        fclose ($myfile);

THE PROBLEM IS...

The file that is written is missing about 400 records!
If I limit the fields to a few, I get all 808 records written no problem.
So, I imagine the problem is the file size - the 400 records equate to
about 131K.
Is there a problem using the fputs() function for larger files?

Thanks for helping me.

-- 
Lawrence Blades
Digital Technologies
P.O. Box 673
Clarksdale, MS 38614
Hm: 662-627-9539
Office: 662-624-6586
Cell: 662-902-3092

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to