fwrite()
| From: | James Kupernik | Date: | Fri, 25 Jan 2002 20:39:16 +0000 |
| Subject: | fwrite() | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-16182@lists.php.net to get a copy of this message | ||
I'm trying to take the contents of a table and write them to a file on my
server. Everything seems to function ok (AKA no errors) but no file gets
written ... I can't figure out why. Can anyone shine some light on this dark
problem?
$db = mysql_connect("localhost","cloft","spring");
mysql_select_db("countryloft");
// get requests from table
$result = mysql_query("SELECT * FROM catalogreq WHERE PROCESSED IS
NULL");
$fp = fopen("$DOCUMENT_ROOT/catalogreq/catalogs.txt","w");
fwrite($fp, $result);
fclose($fp);
$updatereq = mysql_query("UPDATE catalogreq SET PROCESSED = 'Y'");
echo "Thank you!";
Thanks for any help!