NYCPHP Meetup

NYPHP.org

[nycphp-talk] making a manual http POST using a PHP client (USPS web services)

Phillip Powell phillip.powell at adnet-sys.com
Mon Jul 12 11:54:40 EDT 2004


Rolan Yang wrote:

> CURL.
> http://www.php.net/manual/en/ref.curl.php


I have grown to greatly distrust CURL.  It's too simple a solution and I 
don't believe it fully works.  I built a Timer class object based upon 
Curl (using 7.10) for PHP 4.3.2 and it works on all remote URLs except 
for those that are $_COOKIE or $_SESSION-dependent.  In those cases the 
remote url returns incorrect information simply because the remote 
$_COOKIE is not there.

I am thinking the best solution is XML-RPC or SOAP, but for a simple 
page-download-timing scrape, it's way overkill!

Phil

>
> Jayesh Sheth wrote:
>
>> Hello all,
>>
>> please excuse the incoherence in parts of my previous message. (I 
>> really need some more coffee so that I wake up!).
>>
>> Instead of :
>> "So my question is: which function (or objects) should I use in PHP 
>> to do something.",
>>
>> I meant:
>> "So my question is: which function (or objects) should I use in PHP 
>> to do the same thing ?"
>>
>> Thanks!
>>
>> - Jay Sheth
>>
>> _______________________________________________
>> talk mailing list
>> talk at lists.nyphp.org
>> http://lists.nyphp.org/mailman/listinfo/talk
>>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>


-- 
---------------------------------------------------------------------------------
Phil Powell
Multimedia Programmer
BPX Technologies, Inc.
#: (703) 709-7218 x107 
Fax: (703) 709-7219

	


>From hans not junk at nyphp.com  Mon Jul 12 12:11:31 2004
Return-Path: <hans not junk at nyphp.com>
Received: from smtp11.intermedia.net (smtp11.intermedia.net [64.78.21.10])
	by virtu.nyphp.org (Postfix) with ESMTP id DE47BA85EA
	for <talk at lists.nyphp.org>; Mon, 12 Jul 2004 12:11:30 -0400 (EDT)
Received: from ehost011-1.exch011.intermedia.net ([64.78.21.3]) by
	smtp11.intermedia.net with Microsoft SMTPSVC(6.0.3790.0); 
	Mon, 12 Jul 2004 09:02:56 -0700
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: [nycphp-talk] DB resultset
Date: Mon, 12 Jul 2004 09:11:28 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F870306C4E8 at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [nycphp-talk] DB resultset
Thread-Index: AcRl/GbXg8XT9wMhSYOcInLXKoRtZwCLfCIg
From: "Hans Zaunere" <hans not junk at nyphp.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
X-OriginalArrivalTime: 12 Jul 2004 16:02:56.0311 (UTC)
	FILETIME=[B2092C70:01C46829]
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk <talk at lists.nyphp.org>
List-Id: NYPHP Talk <talk.lists.nyphp.org>
List-Unsubscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=unsubscribe>
List-Archive: <http://lists.nyphp.org/pipermail/talk>
List-Post: <mailto:talk at lists.nyphp.org>
List-Help: <mailto:talk-request at lists.nyphp.org?subject=help>
List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Jul 2004 16:11:31 -0000


> It's not a huge resultset and I know how many I need
> for the lifetime of the script.

If it's not that big of a resultset, it might make more sense to just
fetch it all into an array and walk through the array as needed.

> The question is:
>=20
> I don't want to make a different query each time.
> But I was thinking since the resultset is already
> stored in memory by the database server, isn't it a
> wast of time to loop through it and store it in an
> array?

There lies the issue - the resultset isn't stored by the database.  What
you really want is a cursor.  However, I assume we're talking about
MySQL, in which case there are no cursors (they're coming in MySQL 5.0).

You might find some value in these functions:

http://us2.php.net/manual/en/function.mysql-unbuffered-query.php
http://us2.php.net/manual/en/function.mysql-data-seek.php

Depending on the approach you want to take.


H





More information about the talk mailing list