>           $prefilename = date("m-d-y");
>           $filename = "$prefilename.txt";
>           $db = mysql_connect("localhost","cloft","spring");
>           mysql_select_db("countryloft");
>           // get requests from table
>           $result = mysql_query("SELECT * FROM catalogreq WHERE
>           $row = mysql_fetch_array($result);
>           $fileresults = "$row[0],$row[1]\n";
>           $fp = fopen("$DOCUMENT_ROOT/catalogreq/$filename","w");
>           fwrite($fp, $fileresults);
>           fclose($fp);
>           $updatereq = mysql_query("UPDATE catalogreq SET PROCESSED =
> 'Y'");

Add "if" statements around your mysql calls to make sure they are
successful. For instance:


if(!($db = mysql_connect("localhost","cloft","spring"))) {
  die(mysql_error() . "\n");


Place such statements around mysql_query as well. Then... call
mysql_num_rows() on your $result to ensure that rows are being
returned. If all of those things check out okay... right before your
fwrite() statement try this:




See if any data is print out on the screen.

If all of these fail, then chances are your error reporting
parameters are not set correctly and your file open/close commands
are generating errors. Check file permissions and actual interpreted
paths by printing the filenames out before you fopen() them, in the
same fashion that you issue them to fopen(). 

Let us know how it works out.

Daniel J. Lashua

PHP Database 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