+ Reply to Thread
Results 1 to 3 of 3

Thread: any help with: Send data to a Text File

  1. #1
    anilson1 is offline x10Hosting Member anilson1 is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    45

    any help with: Send data to a Text File

    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 by anilson1; 10-29-2008 at 01:02 PM. Reason: Automerged Doublepost

  2. #2
    souradipm is offline x10Hosting Member souradipm is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    45

    Re: any help with: Send data to a Text File

    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 by souradipm; 10-29-2008 at 01:48 PM. Reason: Fixed typos

  3. #3
    dickey's Avatar
    dickey is offline x10 Sophmore dickey is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Singapore
    Posts
    128

    Re: any help with: Send data to a Text File

    try this:
    PHP Code:
    $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); 
    Don't get me wrong as I believe if and when I help someone I also help myself whereby whatever someone learns I also learn.

    But I will also accept credits or reps if you really want to part with it.

+ Reply to Thread

Similar Threads

  1. Replies: 6
    Last Post: 08-25-2008, 09:43 AM
  2. configuring php on localhost
    By ufclan in forum Scripts & 3rd Party Apps
    Replies: 15
    Last Post: 01-22-2008, 08:34 AM
  3. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM
  4. php version
    By loveispoison in forum Free Hosting
    Replies: 10
    Last Post: 11-21-2007, 10:53 AM
  5. Replies: 1
    Last Post: 11-05-2007, 06:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers