User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,479 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,756 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 566 | Replies: 0
Reply
Join Date: Dec 2007
Posts: 1
Reputation: jfhow is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jfhow jfhow is offline Offline
Newbie Poster

Question can't read data files using php inside MAMP

  #1  
Dec 6th, 2007
I developed an online store catalog using PHP & MYSQL on Windows.
It imports tab delimited data for new products from text files in a folder.
While it worked fine on Wndows, when I run it in the MAMP installation on my iMac with Mac OSX it is not working. The site itself works, just not the importing part. I'm not getting any sort of error either, so I don't know what's going on.
Here is the relevant code in PHP:

$data = fopen("data/import_products.txt", "rb");
while (!feof($data)){
$thisline = fgets($data);
echo $thisline;
$v = explode("\t",$thisline);
here it inserts the data into the database
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the PHP Forum

All times are GMT -4. The time now is 2:43 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC