Writing Problems
| From: | Ethan Rosenberg | Date: | Wed, 27 Aug 2014 00:44:49 +0000 |
| Subject: | Writing Problems | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-48907@lists.php.net to get a copy of this message | ||
Dear List -
I can't figure this one out.....
1] Straighten out ownership
ethan@meow:/var/www$ rm receipt.txt
ethan@meow:/var/www$ touch receipt.txt
ethan@meow:/var/www$ ls -l receipt.txt
-rw-r--r-- 1 ethan ethan 0 Aug 26 19:31 receipt.txt
ethan@meow:/var/www$ chmod 766 receipt.txt
ethan@meow:/var/www$ ls -l receipt.txt
-rwxrw-rw- 1 ethan ethan 0 Aug 26 19:31 receipt.txt
This is what we want
2] Now program code ....
ini_set('display_startup_errors', 'on');
error_reporting(E_ALL | E_NOTICE);
ini_set('display_errors','1');
error_reporting(1);
$fh2 = fopen("/var/www/receipt.txt", "a+");
want this file to be like a cash register receipt. I can truncate this file for each execution of the program; ie, when all the purchases are finished.
$sql3 = "select quant, orderpt, ordrpt_flag, manuf, item, stock, price, tax_flag from Inventory where UPC = $upc";
$result3 = mysqli_query($cxn, $sql3);
$row3 = mysqli_fetch_row($result3);
print_r($row3 ); //gives correct results.
$numbyt=fprintf($fh2, "%s %s %.2f %s\n",$row3[3] , $row3[4], $row3[6], $row3[7]);
echo "<br />numbyt fh2 $numbyt<br />"; //result is 0
No errors.
What is wrong??
TIA
Ethan