ameriblog Posted August 27, 2007 Share Posted August 27, 2007 i have php script that is working in writing to a file, but i was wanting to customize it a bit better: <? $file = 'ncaa_ratings.txt'; require ( "dbconnex.php" ); $games_rs = $conn->Execute ( "SELECT * FROM ncaa_gm WHERE game_year = " . $_GET['year'] . " ORDER BY gameID DESC" ) or die ( $conn->ErrorMsg() ); $file= fopen('ncaa_ratings.txt' , 'w'); while ( ! $games_rs->EOF ) { $txt_output .= THIS IS WHERE I WANT MY INPUT; } fputs($file, $txt_output); fclose($file); ?> What I'd like to do is get 4-5 fields from the table and have them in CSV format, so: Field1,Field2,Field3,Field4,Field5 Link to comment https://forums.phpfreaks.com/topic/66820-writing-to-a-text-file/ Share on other sites More sharing options...
Fadion Posted August 27, 2007 Share Posted August 27, 2007 Take a look at this mysql to csv tutorial Link to comment https://forums.phpfreaks.com/topic/66820-writing-to-a-text-file/#findComment-334981 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.