php-windows Digest 9 Aug 2003 09:32:39 -0000 Issue 1861
Topics (messages 21087 through 21090):
michaels question...
21087 by: Daniel
php, oracle and xitami web server
21088 by: ZeeJay
EncPHP, turns PHP scripts into EXEs
21089 by: Adam Zey
Subject: selecting data from file with php
21090 by: Neil Smith
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
to answer michaels question...
to use a relative path, you must not include the "/" at
the beginning of the path. if you have "/" at the
beginning of the path, it goes all the way to the root
directory. to access the relative folder
"files/include.inc", type "files/include.inc", instead of
"/files/include.inc" with the preceding slash.
~foobaz
--- End Message ---
--- Begin Message ---
Hi,
I have php on windows 2000 running in cgi mode using Xitami Web Server ....
I want to connect to an Oracle 8i db.
what do I need to do?
I already added the php_oracle.dll to winnt/system32 and removed the ; from
the extensions block in php.ini ...
nothing so far...
do I need another dll ? am I missing something?
environment variables?
what's the simplest php page that I could code to test if this works?
thanks,
CJ.-
--- End Message ---
--- Begin Message ---
Hey,
I've written a program to encapsulate a PHP script inside an EXE, along with
everything the script needs to run. The net result is to make a PHP script
completely portable, without the need for the client PC to have PHP
installed.
The website is a bit of a mess (Not done yet), so I point you towards the
SourceForge site for the project: http://sourceforge.net/projects/encphp
Though if you really want to see the incomplete website, feel free to click
the "Home Page" link from there.
The newest version released is build 2, which is functional and usable.
Regards, Guspaz.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 04/08/2003
--- End Message ---
--- Begin Message ---
I would do something like this, your mileage may vary. Lines starting with
// are comments.
$addresscities=array();
// Make an empty array
$resultrows=file("address.txt");
// This creates an array of lines of the file, one element per line
foreach ($resultrows as $line) {
$row=explode("\t",$line);
// Chop up the row into 3 fields separated by the tab (\t) character
// You must use double quotes for PHP to read \t as a tab character
$addresscities[$row[2]]= $addresscities[$row[2]]+1;
// Add a count of one to the value in $addresscities[`cityname`]
// If an array element like that does not exist it will be created
// and one added to its initial value (effctoiely, zero), making a count of 1.
}
// End looping though the result rows
ksort($addresscities);
// Sort the array keys (city names) alphabetically
You now have an array containing entries like :
$addresscities["dallas"] ........ 15
$addresscities["mexico"] ........ 1
or whatever. You can do pretty much what you want with that data.
In SQL you would import the file once as a CSV or similar format, then do :
SELECT city, COUNT(city) AS address
GROUP BY city
ORDER BY city
to get a summary of people in each city. Much simpler, isn't it ? ;-)
I would definitely go with SQL for address data, you can get complex
breakdowns of data with almost no re-programming, and this sort of data is
made for a database !
Cheers - Neil.
I do not accept mail from hotmail yahoo or other free accounts. Please
reply only on list.
All mail from these accounts *will* be bounced and the account blacklisted.
Thankyou.
At 19:00 08/08/2003 +0000, you wrote:
Message-ID: <[EMAIL PROTECTED]>
Date: Fri, 8 Aug 2003 12:00:12 -0700 (PDT)
From: Idur <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="0-779152822-1060369212=:59102"
Subject: selecting data from file with php
hi there,....
i have file address.txt, it's content of address of customer, like this ;
name age city
jony 27 new york
george 25 dallas
mony 23 mexico
edward 30 new york
budy 22 dallas
dennise 21 new york
hox to count the field of city, so the result is, like this
city count
dallas 2
new york 3
mexico 1
so i know how many user from a specific city, for the information i am not
using mysql. Is that to difficult to do it with out mysql...??
Did php have the function to do selecting data like mysql....???
thanx
========================================================
CaptionKit http://www.captionkit.com : Production tools
for accessible subtitled internet media, transcripts
and searchable video. Supports Real Player, Quicktime
and Windows Media Player.
VideoChat with friends online, get Freshly Toasted every
day at http://www.fresh-toast.net : NetMeeting solutions
for a connected world.
--- End Message ---