php-windows Digest 9 Aug 2003 22:05:29 -0000 Issue 1862
Topics (messages 21091 through 21095):
Re: Subject: selecting data from file with php
21091 by: Svensson, B.A.T. (HKG)
Contact Management Scripts?
21092 by: Arthur
How to compile a win32 php extension module ???
21093 by: Ika Oscaos
21094 by: Adam Zey
21095 by: DvDmanDT
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 ---
Another option wuld be to couple the text file with ODBC, and
then the text file can be treated as a relational database table,
e.g. a SELECT [...] would work fine on the text file.
-----Original Message-----
From: Neil Smith
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: 9-8-03 11:55
Subject: [PHP-WIN] Subject: selecting data from file with php
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.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I am looking for a Contact Management system. I found these on the web:
http://www.horde.org/turba/
http://www.phprojekt.com/
Does anyone have experience with these or do you know of others?
Many thanks
Arthur
--- End Message ---
--- Begin Message ---
Hello,
I have developed a php extension module. I can compile it with Linux. I can
build a module.so file. I search a documentation for creating the same
module (module.dll) for Win32 plateform. Is there a documentation that
explain how to compile an extension module for win32 ?
Thanks for your Help
--
Ika
--- End Message ---
--- Begin Message ---
I've never done it, but I'd imagine you'd be able to get a copy of gcc for
windows and compile it.
Regards, Guspaz.
"Ika Oscaos" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I have developed a php extension module. I can compile it with Linux. I
can
> build a module.so file. I search a documentation for creating the same
> module (module.dll) for Win32 plateform. Is there a documentation that
> explain how to compile an extension module for win32 ?
>
> Thanks for your Help
>
> --
> Ika
>
>
---
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'd use VC++ and compile it... I think I can do it if you send the source...
Not sure though, never compiled myself before... HMm.. Yes, I have...
Well...
You make a project and compile I think...
--
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]
"Ika Oscaos" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Hello,
>
> I have developed a php extension module. I can compile it with Linux. I
can
> build a module.so file. I search a documentation for creating the same
> module (module.dll) for Win32 plateform. Is there a documentation that
> explain how to compile an extension module for win32 ?
>
> Thanks for your Help
>
> --
> Ika
>
>
--- End Message ---