any help with: Send data to a Text File

anilson1

New Member
Messages
45
Reaction score
0
Points
0
I am having difficulties getting some data from a database to a file text. Can anyone check if my code is right?

p.s. I know you will ask why take from database to txt file. I have to clean every week the db but I don't want to lose the info, so, I keep it on a txt file.

---------------


$printFileName = $plainfiledate;

$printFileHandle = fopen($printFileName, 'a') or die("can't open file");

fwrite($printFileHandle,$line['PersonalID'],$line['GroupName'],$line['SlipNum'],$line['DrawNum'],$line['Num1'],$line['Num2'],$line['Num3'],$line['Num4'],$line['Num5'],$line['Num6'],$line['Num7']);

fclose($printFileHandle);
Edit:
Warning: Wrong parameter count for fwrite() in /home/anilson1/public_html/VOGLogs/proccessingMANAGER.php on line 63


above is the messega that I get
 
Last edited:

souradipm

New Member
Messages
45
Reaction score
0
Points
0
http://uk.php.net/fwrite

There are only 2 required parameters to fwrite. Perhaps you mean something like:
Code:
fwrite($printFileHandle,$line['PersonalID']."<br>".$line['GroupName']."<br>".$line['SlipNum']."<br>".$line['DrawNum']."<br>".$line['Num1']."<br>".$line['Num2']."<br>".$line['Num3']."<br>".$line['Num4']."<br>".$line['Num5']."<br>".$line['Num6']."<br>".$line['Num7']);
(Pseudo-code)
 
Last edited:

dickey

New Member
Messages
128
Reaction score
0
Points
0
try this:
PHP:
$printFileName = $plainfiledate;

$printFileHandle = fopen($printFileName, 'a') or die("can't open file");
$ln=$line['PersonalID'].$line['GroupName'].$line['SlipNum'].$line['DrawNum'].$line['Num1'].$line['Num2'].$line['Num3'].$line['Num4'].$line['Num5'].$line['Num6'].$line['Num7'];
fwrite($printFileHandle,$ln);

fclose($printFileHandle);
 
Top