|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 15 Feb 2007 02:52:08 -0000 Issue 4626
php-general-digest-help
lists.php.net
Date: Wed Feb 14 2007 - 20:52:08 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 15 Feb 2007 02:52:08 -0000 Issue 4626
Topics (messages 248841 through 248895):
Re: How to upload files up to 40MB with a html post form?
248841 by: Robert Cummings
248845 by: Colin Guthrie
248848 by: Robert Cummings
248849 by: Colin Guthrie
248853 by: Robert Cummings
248854 by: Andrei
248855 by: Robert Cummings
248856 by: Sergiu Voicu
248857 by: Arpad Ray
248860 by: David Blanco
248861 by: Robert Cummings
PHP/PEAR
248842 by: Malcolm Pickering
248843 by: Robert Cummings
248844 by: Jochem Maas
248846 by: Robert Cummings
248847 by: Colin Guthrie
248850 by: Jochem Maas
248858 by: Gregory Beaver
248888 by: Bruce Cowin
FTP + Password ?
248851 by: Helder Lopes
[JOB] Junior Applications Developers - San Antonio TX
248852 by: Jay Blanchard
Re: [?? Probable Spam] Re: [PHP] Re: How to upload files up to 40MB with a html post form?
248859 by: Andrei
Banner rotation with links
248862 by: Chris Carter
248863 by: Németh Zoltán
248864 by: Tim
248865 by: Brad Fuller
248866 by: Tim
Object ID
248867 by: Eli
248870 by: Roman Neuhauser
248882 by: Eli
248890 by: Richard Lynch
248891 by: Eli
248893 by: Eli
Rounding -- was [PHP] round to nearest 500?
248868 by: tedd
Re: Getting mysql_query results into an array
248869 by: Bill Guion
248881 by: Kristen G. Thorson
248883 by: Jochem Maas
248885 by: Brad Fuller
248892 by: Richard Lynch
248894 by: Richard Lynch
PHP 4.4.5 Released
248871 by: Derick Rethans
Retrieve value of newly inserted row.
248872 by: Dan Shirah
248873 by: Robert Cummings
248874 by: Arpad Ray
248875 by: Tim
248876 by: Robert Cummings
248877 by: Tim
248878 by: Robert Cummings
248879 by: Dan Shirah
248880 by: Brad Fuller
248884 by: Jim Lucas
Foldable Checkbox lists
248886 by: bschwartz.tricom.com
248887 by: Jay Blanchard
248889 by: Eric Butera
Extending DOMNode
248895 by: Eli
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
On Wed, 2007-02-14 at 13:54 +0100, David Blanco wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hola!
>
> Mauricio Muriel escribió:
>
> > How can I upload files up to 40MB with a html post form? (without a ftp
> > client)
> >
> > Please, remember
> >
> > 1. My hosting provider has up to 120 seconds apache timeout
> > 2. My hosting provider has up to 10MB to upload files in php.ini
> >
> > Any kind of ideas?
>
> Yes, use CGI & Perl.
>
> Note: I love PHP but also know its limitations :)
Upload sizes are not a PHP limitation. If a limitation at all then it's
a limitation imposed by the service provider. As such Perl won't solve
the problem unless the provider was short sighted enough to cap PHP and
not Perl... if they even offer Perl to their users.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Robert Cummings wrote:
> On Wed, 2007-02-14 at 13:54 +0100, David Blanco wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hola!
>>
>> Mauricio Muriel escribió:
>>
>>> How can I upload files up to 40MB with a html post form? (without a ftp
>>> client)
>>>
>>> Please, remember
>>>
>>> 1. My hosting provider has up to 120 seconds apache timeout
>>> 2. My hosting provider has up to 10MB to upload files in php.ini
>>>
>>> Any kind of ideas?
>> Yes, use CGI & Perl.
>>
>> Note: I love PHP but also know its limitations :)
>
> Upload sizes are not a PHP limitation.
Erm, what about the max file size limit in php.ini? Is that not a PHP
limitiation that the provider has turned on?
Col
Col.
attached mail follows:
On Wed, 2007-02-14 at 14:05 +0000, Colin Guthrie wrote:
> Robert Cummings wrote:
> > On Wed, 2007-02-14 at 13:54 +0100, David Blanco wrote:
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> Hola!
> >>
> >> Mauricio Muriel escribió:
> >>
> >>> How can I upload files up to 40MB with a html post form? (without a ftp
> >>> client)
> >>>
> >>> Please, remember
> >>>
> >>> 1. My hosting provider has up to 120 seconds apache timeout
> >>> 2. My hosting provider has up to 10MB to upload files in php.ini
> >>>
> >>> Any kind of ideas?
> >> Yes, use CGI & Perl.
> >>
> >> Note: I love PHP but also know its limitations :)
> >
> > Upload sizes are not a PHP limitation.
>
> Erm, what about the max file size limit in php.ini? Is that not a PHP
> limitiation that the provider has turned on?
No, that's a configuration value set my the provider. A PHP limitation
would be if you couldn't change the value.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Robert Cummings wrote:
> On Wed, 2007-02-14 at 14:05 +0000, Colin Guthrie wrote:
>> Robert Cummings wrote:
>>> On Wed, 2007-02-14 at 13:54 +0100, David Blanco wrote:
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>>
>>>> Hola!
>>>>
>>>> Mauricio Muriel escribió:
>>>>
>>>>> How can I upload files up to 40MB with a html post form? (without a ftp
>>>>> client)
>>>>>
>>>>> Please, remember
>>>>>
>>>>> 1. My hosting provider has up to 120 seconds apache timeout
>>>>> 2. My hosting provider has up to 10MB to upload files in php.ini
>>>>>
>>>>> Any kind of ideas?
>>>> Yes, use CGI & Perl.
>>>>
>>>> Note: I love PHP but also know its limitations :)
>>> Upload sizes are not a PHP limitation.
>> Erm, what about the max file size limit in php.ini? Is that not a PHP
>> limitiation that the provider has turned on?
>
> No, that's a configuration value set my the provider. A PHP limitation
> would be if you couldn't change the value.
That's still a limitation, regardless if it is configurable or not:
Limitation: That which limits; a restriction; a qualification; a
restraining condition, defining circumstance, or
qualifying conception; as, limitations of thought.
[1913 Webster]
But I see the point you were making, just didn't read your reply clearly
enough - I've been up too late :p
Col
attached mail follows:
On Wed, 2007-02-14 at 14:22 +0000, Colin Guthrie wrote:
> Robert Cummings wrote:
> > On Wed, 2007-02-14 at 14:05 +0000, Colin Guthrie wrote:
> >> Robert Cummings wrote:
> >>> On Wed, 2007-02-14 at 13:54 +0100, David Blanco wrote:
> >>>> -----BEGIN PGP SIGNED MESSAGE-----
> >>>> Hash: SHA1
> >>>>
> >>>> Hola!
> >>>>
> >>>> Mauricio Muriel escribió:
> >>>>
> >>>>> How can I upload files up to 40MB with a html post form? (without a ftp
> >>>>> client)
> >>>>>
> >>>>> Please, remember
> >>>>>
> >>>>> 1. My hosting provider has up to 120 seconds apache timeout
> >>>>> 2. My hosting provider has up to 10MB to upload files in php.ini
> >>>>>
> >>>>> Any kind of ideas?
> >>>> Yes, use CGI & Perl.
> >>>>
> >>>> Note: I love PHP but also know its limitations :)
> >>> Upload sizes are not a PHP limitation.
> >> Erm, what about the max file size limit in php.ini? Is that not a PHP
> >> limitiation that the provider has turned on?
> >
> > No, that's a configuration value set my the provider. A PHP limitation
> > would be if you couldn't change the value.
>
> That's still a limitation, regardless if it is configurable or not:
>
> Limitation: That which limits; a restriction; a qualification; a
> restraining condition, defining circumstance, or
> qualifying conception; as, limitations of thought.
> [1913 Webster]
There's no argument that it's a limitation. But it's set by the
provider, thus it's not a PHP limitation. Please try again.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
LOL. You got lost in details...
To answer the question... You cannot upload files bigger than 10Mb
unless your provider changes the values from php.ini (regarding upload
file size, form max size and memory max size) and you cannot upload even
less than 10Mb files if the time needed to upload it takes longer than
120 seconds.
Andrei
Robert Cummings wrote:
> On Wed, 2007-02-14 at 14:22 +0000, Colin Guthrie wrote:
>
>> Robert Cummings wrote:
>>
>>> On Wed, 2007-02-14 at 14:05 +0000, Colin Guthrie wrote:
>>>
>>>> Robert Cummings wrote:
>>>>
>>>>> On Wed, 2007-02-14 at 13:54 +0100, David Blanco wrote:
>>>>>
>>>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>>>> Hash: SHA1
>>>>>>
>>>>>> Hola!
>>>>>>
>>>>>> Mauricio Muriel escribió:
>>>>>>
>>>>>>
>>>>>>> How can I upload files up to 40MB with a html post form? (without a ftp
>>>>>>> client)
>>>>>>>
>>>>>>> Please, remember
>>>>>>>
>>>>>>> 1. My hosting provider has up to 120 seconds apache timeout
>>>>>>> 2. My hosting provider has up to 10MB to upload files in php.ini
>>>>>>>
>>>>>>> Any kind of ideas?
>>>>>>>
>>>>>> Yes, use CGI & Perl.
>>>>>>
>>>>>> Note: I love PHP but also know its limitations :)
>>>>>>
>>>>> Upload sizes are not a PHP limitation.
>>>>>
>>>> Erm, what about the max file size limit in php.ini? Is that not a PHP
>>>> limitiation that the provider has turned on?
>>>>
>>> No, that's a configuration value set my the provider. A PHP limitation
>>> would be if you couldn't change the value.
>>>
>> That's still a limitation, regardless if it is configurable or not:
>>
>> Limitation: That which limits; a restriction; a qualification; a
>> restraining condition, defining circumstance, or
>> qualifying conception; as, limitations of thought.
>> [1913 Webster]
>>
>
> There's no argument that it's a limitation. But it's set by the
> provider, thus it's not a PHP limitation. Please try again.
>
> Cheers,
> Rob.
>
attached mail follows:
On Wed, 2007-02-14 at 16:51 +0200, Andrei wrote:
> LOL. You got lost in details...
> To answer the question... You cannot upload files bigger than 10Mb
> unless your provider changes the values from php.ini (regarding upload
> file size, form max size and memory max size) and you cannot upload even
> less than 10Mb files if the time needed to upload it takes longer than
> 120 seconds.
Which comes back to the original advice (Jay's I think)... get a new
provider :B
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Upload limits can be imposed in 2 ways (maybe more, but I know only 2)
when it is about Apache+PHP:
1. From apache with LimitRequestBody Directive
2. From php.ini with upload_max_filesize directive
If you are in the first case (which I doubt), and the provider allows
the use of .htaccess files, create a .htaccess file in the document root
and put this line into it:
LimitRequestBody 42991616
In the second case, and if PHP isn't in safe mode, at the beggining of
your script place this line
ini_set("upload_max_filesize","41M");
Cheers
Sergiu
Robert Cummings wrote:
> On Wed, 2007-02-14 at 16:51 +0200, Andrei wrote:
>> LOL. You got lost in details...
>> To answer the question... You cannot upload files bigger than 10Mb
>> unless your provider changes the values from php.ini (regarding upload
>> file size, form max size and memory max size) and you cannot upload even
>> less than 10Mb files if the time needed to upload it takes longer than
>> 120 seconds.
>
> Which comes back to the original advice (Jay's I think)... get a new
> provider :B
>
> Cheers,
> Rob.
attached mail follows:
Sergiu Voicu wrote:
> In the second case, and if PHP isn't in safe mode, at the beggining of
> your script place this line
> ini_set("upload_max_filesize","41M");
ini_set() will have no effect there because by the time the script is
executed, the upload has finished.
You can probably use php_value to set it in the .htaccess - that depends
on the setting of AllowOverride and that php is running as an apache module.
Arpad
attached mail follows:
Hi!
Robert Cummings wrote:
> ... Upload sizes are not a PHP limitation. If a limitation at all
> then it's a limitation imposed by the service provider. As such
> Perl won't solve the problem unless the provider was short sighted
> enough to cap PHP and not Perl... if they even offer Perl to their
> users.
IMHO it's not a PHP limitation, I could said that in a better way.
I was thinking in the fact that Perl can read the STDIN as a buffer
and then it allows you to simulate a sort of progress bar using AJAX,
for example (i have done it). I think that this is not possible with
PHP (please correct me if I'm wrong) without using some trick like
patching the code (there is already a patch). I give very much
importance to this because the user who's uploading 40MB wants to know
what's happening and how much time will it take to upload the file(s).
Sorry for the misunderstood.
Greetings
--
David Blanco - Programación y sistemas
Publicinet (Publicidad-Cine-Internet, S.L.)
Urzaiz, 71, entlo, izda. -- 36204 Vigo
Telf 902.014.606 -- http://www.publicinet.net
attached mail follows:
On Wed, 2007-02-14 at 16:46 +0100, David Blanco wrote:
> Hi!
>
> Robert Cummings wrote:
>
> > ... Upload sizes are not a PHP limitation. If a limitation at all
> > then it's a limitation imposed by the service provider. As such
> > Perl won't solve the problem unless the provider was short sighted
> > enough to cap PHP and not Perl... if they even offer Perl to their
> > users.
>
> IMHO it's not a PHP limitation, I could said that in a better way.
>
> I was thinking in the fact that Perl can read the STDIN as a buffer
> and then it allows you to simulate a sort of progress bar using AJAX,
> for example (i have done it). I think that this is not possible with
> PHP (please correct me if I'm wrong) without using some trick like
> patching the code (there is already a patch). I give very much
> importance to this because the user who's uploading 40MB wants to know
> what's happening and how much time will it take to upload the file(s).
PHP has a CLI version that should be able to do the same.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Hello there,
As a new user of PHP I am finding it extremely useful, very fast, and rewarding. I was also delighted to find the already proven and maintained extensions in PEAR.
I have recently downloaded one of these extensions (HTML_Table) which is proving to be a great time saver, but can you tell me, please, why every time I access one of the associated pages or scripts my computer tries to dial out. Yes, I am still on Dial-Up. Is this some vital function that is required by your extension, or is there some information you need which has not already been given? If it is neither of these, how do I stop it because I find it infuriating.
Hoping you can help me,
Malcolm Pickering.
attached mail follows:
On Wed, 2007-02-14 at 13:29 +0100, Malcolm Pickering wrote:
> Hello there,
>
> As a new user of PHP I am finding it extremely useful, very fast, and rewarding. I was also delighted to find the already proven and maintained extensions in PEAR.
>
> I have recently downloaded one of these extensions (HTML_Table) which is proving to be a great time saver, but can you tell me, please, why every time I access one of the associated pages or scripts my computer tries to dial out. Yes, I am still on Dial-Up. Is this some vital function that is required by your extension, or is there some information you need which has not already been given? If it is neither of these, how do I stop it because I find it infuriating.
I don't use PEAR but it's probably calling home to check for updates
(and this launches your system's dialer to connect to the internet).
Check the docs and you'll more than likely find a way to disable
automatic checks.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Malcolm Pickering wrote:
> Hello there,
>
> As a new user of PHP I am finding it extremely useful, very fast, and rewarding. I was also delighted to find the already proven and maintained extensions in PEAR.
>
> I have recently downloaded one of these extensions (HTML_Table) which is proving to be a great time saver, but can you tell me, please, why every time I access one of the associated pages or scripts my computer tries to dial out. Yes, I am still on Dial-Up. Is this some vital function that is required by your extension, or is there some information you need which has not already been given? If it is neither of these, how do I stop it because I find it infuriating.
it's nothing to do with php - it's your POS browser - it thinks that your connecting to the internet because your
sahooting out a http connection (which is actually aimed at the localhost) and therefore tries to connect (because it
thinks that is required) ... either fix the browser settings or download a 'better' browser:
http://www.mozilla.com/en-US/firefox
>
> Hoping you can help me,
>
> Malcolm Pickering.
>
attached mail follows:
On Wed, 2007-02-14 at 15:02 +0100, Jochem Maas wrote:
> Malcolm Pickering wrote:
> > Hello there,
> >
> > As a new user of PHP I am finding it extremely useful, very fast, and rewarding. I was also delighted to find the already proven and maintained extensions in PEAR.
> >
> > I have recently downloaded one of these extensions (HTML_Table) which is proving to be a great time saver, but can you tell me, please, why every time I access one of the associated pages or scripts my computer tries to dial out. Yes, I am still on Dial-Up. Is this some vital function that is required by your extension, or is there some information you need which has not already been given? If it is neither of these, how do I stop it because I find it infuriating.
>
> it's nothing to do with php - it's your POS browser - it thinks that your connecting to the internet because your
> sahooting out a http connection (which is actually aimed at the localhost) and therefore tries to connect (because it
> thinks that is required) ... either fix the browser settings or download a 'better' browser:
>
> http://www.mozilla.com/en-US/firefox
Why be half-assed about choosing a better browser...
http://www.opera.com/download/
*ducks* ;)
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Malcolm Pickering wrote:
> Hello there,
>
> As a new user of PHP I am finding it extremely useful, very fast, and
> rewarding. I was also delighted to find the already proven and
> maintained extensions in PEAR.
>
> I have recently downloaded one of these extensions (HTML_Table) which
> is proving to be a great time saver, but can you tell me, please, why
> every time I access one of the associated pages or scripts my
> computer tries to dial out. Yes, I am still on Dial-Up. Is this some
> vital function that is required by your extension, or is there some
> information you need which has not already been given? If it is
> neither of these, how do I stop it because I find it infuriating.
Is this happening on every PHP page? If it happening on every plain HTML
page? If so I'd guess Apache or similar is doing DNS lookups. Either
that or some PHP extension is doing DNS lookups.
Try disabling various PHP extensions (assuming it does not try to dial
out on a plain HTML page) to narrow it down and you can probably work
out what /etc/hosts (or %WINDOWS%\system32\drivers\etc\hosts) hacks to
put in to prevent it or what config option to tweak.
HTH
Col
attached mail follows:
Robert Cummings wrote:
> On Wed, 2007-02-14 at 15:02 +0100, Jochem Maas wrote:
>> Malcolm Pickering wrote:
>>> Hello there,
>>>
>>> As a new user of PHP I am finding it extremely useful, very fast, and rewarding. I was also delighted to find the already proven and maintained extensions in PEAR.
>>>
>>> I have recently downloaded one of these extensions (HTML_Table) which is proving to be a great time saver, but can you tell me, please, why every time I access one of the associated pages or scripts my computer tries to dial out. Yes, I am still on Dial-Up. Is this some vital function that is required by your extension, or is there some information you need which has not already been given? If it is neither of these, how do I stop it because I find it infuriating.
>> it's nothing to do with php - it's your POS browser - it thinks that your connecting to the internet because your
>> sahooting out a http connection (which is actually aimed at the localhost) and therefore tries to connect (because it
>> thinks that is required) ... either fix the browser settings or download a 'better' browser:
>>
>> http://www.mozilla.com/en-US/firefox
>
> Why be half-assed about choosing a better browser...
>
> http://www.opera.com/download/
>
> *ducks* ;)
which reminds me ...
man walks into a doctors office wityh a duck stuck to his face.
doctor says "what can I do for you?".
ducks says "get the man off my ass"
or something like that. :-)
>
> Cheers,
> Rob.
attached mail follows:
Malcolm Pickering wrote:
> Hello there,
>
> As a new user of PHP I am finding it extremely useful, very fast, and rewarding. I was also delighted to find the already proven and maintained extensions in PEAR.
>
> I have recently downloaded one of these extensions (HTML_Table) which is proving to be a great time saver, but can you tell me, please, why every time I access one of the associated pages or scripts my computer tries to dial out. Yes, I am still on Dial-Up. Is this some vital function that is required by your extension, or is there some information you need which has not already been given? If it is neither of these, how do I stop it because I find it infuriating.
>
> Hoping you can help me,
Hi Malcolm,
Sorry to hear about your trouble with HTML_Table. As you use PEAR
packages, you should also know about the pear-general
lists.php.net
support list, PEAR users and developers regularly answer queries on
package usage and help with troubles like yours with possibly more
detail than you will find on php-general.
In this case, I have to agree, this sounds more like a browser issue.
HTML_Table does not use any remote access functionality, the suggestion
that it would try to do so is not very accurate or helpful, as the only
PEAR libraries that access the internet say so explicitly in their
package description and/or documentation.
The manual for PEAR is at http://pear.php.net/manual/en (english).
Good luck,
Greg
attached mail follows:
that reminds me:
a woman walks into a bar carrying a duck. the bartender says "hey, you can't come in here with that pig". the woman says "it's not a pig, it's a duck". and the bartender says "i was talking to the duck".
Regards,
Bruce
>>> Jochem Maas <jochem
iamjochem.com> 15/02/2007 3:36:56 a.m. >>>
Robert Cummings wrote:
> On Wed, 2007-02-14 at 15:02 +0100, Jochem Maas wrote:
>> Malcolm Pickering wrote:
>>> Hello there,
>>>
>>> As a new user of PHP I am finding it extremely useful, very fast, and rewarding. I was also delighted to find the already proven and maintained extensions in PEAR.
>>>
>>> I have recently downloaded one of these extensions (HTML_Table) which is proving to be a great time saver, but can you tell me, please, why every time I access one of the associated pages or scripts my computer tries to dial out. Yes, I am still on Dial-Up. Is this some vital function that is required by your extension, or is there some information you need which has not already been given? If it is neither of these, how do I stop it because I find it infuriating.
>> it's nothing to do with php - it's your POS browser - it thinks that your connecting to the internet because your
>> sahooting out a http connection (which is actually aimed at the localhost) and therefore tries to connect (because it
>> thinks that is required) ... either fix the browser settings or download a 'better' browser:
>>
>> http://www.mozilla.com/en-US/firefox
>
> Why be half-assed about choosing a better browser...
>
> http://www.opera.com/download/
>
> *ducks* ;)
which reminds me ...
man walks into a doctors office wityh a duck stuck to his face.
doctor says "what can I do for you?".
ducks says "get the man off my ass"
or something like that. :-)
>
> Cheers,
> Rob.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
i people. I need a help.
How to put a password in a folder, in the ftp, via a script?
Anybody knows??
Im pt, Sorry for my english!!
attached mail follows:
Good morning folks!
I have an urgent need for two intermediate PHP developers (1.5 - 2 years), no degree required, but needs to have demonstrable equivalent work experience. These are currently slated as 6 month positions (likely to be permanent) with a rapidly growing and very exciting company. I know it sounds clichéd, but if you like a fast paced environment you will love it here.
So if you are in the San Antonio TX area or know of someone who fits the bill please send them and their résumé's my way. Forward this to others. I need to get these butts in seats within the next few days. Telecommuting contracts are not currently an option. Please e-mail me off-list about questions.
Jay
-----------------------------------------------------------
Summary:
This position is responsible for the architecture, development and maintenance of web, back end infrastructure applications, and public internet web sites. Programs, tests and debugs all applications in appropriate QA environment, adhering to departmental standards, policies and procedures. Performs all tasks and completes projects based upon an extensive knowledge of the local computing environment. Technical understanding of all hardware, server O/S, and application connectivity between servers, the Internet is required. Software knowledge base should include PHP, MySQL, HTML, JavaScript, CSS, and XML. Other desirable software knowledge includes C++ and TCP communication protocols. Knowledge of Linux operating systems is a plus.
Duties and Responsibilities
* Work with Senior Application development staff, as well as business and product departments to develop and write application systems and programs.
* Work within production control guidelines for web postings and/or production application changes.
* Testing of each solution to ensure proper performance and efficiency guidelines are met.
* Obtains and maintains a working knowledge of operating systems and hardware used by the Web and Development groups, and systemic relationships with outside service providers and designers.
* Documents programs in accordance with development standards and procedures. Create and/or modify current documentation.
* Participate in "on-call" call support for applications developed in-house.
* Other projects/duties as assigned.
Job Requirements
* Strong knowledge of relational database concepts (preferably MySQL, Oracle, MS-SQL).
* 1-2 years experience in application development using PHP and/or C++.
* Ability to develop applications using Internet Communication Protocols (TCP/IP).
* Ability to prioritize multiple tasks and work with end users to meet appropriate deadlines.
* Trains incoming staff on program functionality, design, and architecture.
* Great attention to detail.
* Ability to handle multiple tasks.
* Excellent organizational skills.
* Foster company success through a professional appearance, being courteous to customers & all Pocket associates, and by having a positive attitude.
Required Education
* Required Education: Bachelor degree in MIS or Computer Science or Business or related field or equivalent experience preferred.
attached mail follows:
Actually there are 3 directives to change:
ini_set("upload_max_filesize","41M");
ini_set("post_max_size","52M"); // alyway bigger than upload_max_filesize
ini_set("memory_limit","64M"); // anyway bigger than post_max_size
Presuming you got over 120 seconds time limitation and this still
doesn't change a thing and you still cannot upload the file it might be
because PHP script is not parsed BEFORE receiving the post data (the
uploaded file) thus using the php.ini file values of
upload_max_filesize, post_max_size and memory_limit.
Andrei
Sergiu Voicu wrote:
> Upload limits can be imposed in 2 ways (maybe more, but I know only 2)
> when it is about Apache+PHP:
> 1. From apache with LimitRequestBody Directive
> 2. From php.ini with upload_max_filesize directive
>
> If you are in the first case (which I doubt), and the provider allows
> the use of .htaccess files, create a .htaccess file in the document
> root and put this line into it:
> LimitRequestBody 42991616
>
> In the second case, and if PHP isn't in safe mode, at the beggining of
> your script place this line
> ini_set("upload_max_filesize","41M");
>
>
> Cheers
> Sergiu
>
> Robert Cummings wrote:
>> On Wed, 2007-02-14 at 16:51 +0200, Andrei wrote:
>>> LOL. You got lost in details...
>>> To answer the question... You cannot upload files bigger than 10Mb
>>> unless your provider changes the values from php.ini (regarding upload
>>> file size, form max size and memory max size) and you cannot upload
>>> even
>>> less than 10Mb files if the time needed to upload it takes longer than
>>> 120 seconds.
>>
>> Which comes back to the original advice (Jay's I think)... get a new
>> provider :B
>>
>> Cheers,
>> Rob.
>
attached mail follows:
How can I rotate a banner as well as the link in it within a page using PHP.
This can be done as a include file php. Anybody please supply some code or a
link for this.
Thanks in advance.
Chris
--
View this message in context: http://www.nabble.com/Banner-rotation-with-links-tf3228157.html#a8968148
Sent from the PHP - General mailing list archive at Nabble.com.
attached mail follows:
2007. 02. 14, szerda keltezéssel 08.29-kor Chris Carter ezt Ãrta:
> How can I rotate a banner as well as the link in it within a page using PHP.
> This can be done as a include file php. Anybody please supply some code or a
> link for this.
please go STFW for "banner rotation php script"
greets
Zoltán Németh
>
> Thanks in advance.
>
> Chris
> --
> View this message in context: http://www.nabble.com/Banner-rotation-with-links-tf3228157.html#a8968148
> Sent from the PHP - General mailing list archive at Nabble.com.
>
attached mail follows:
> -----Message d'origine-----
> De : Chris Carter [mailto:chandan9sharma
yahoo.com]
> Envoyé : mercredi 14 février 2007 17:29
> À : php-general
lists.php.net
> Objet : [PHP] Banner rotation with links
>
>
> How can I rotate a banner as well as the link in it within a
> page using PHP.
> This can be done as a include file php. Anybody please supply
> some code or a link for this.
>
> Thanks in advance.
Hi depends on "what moment you are changing the banner" if you are doing it
on a page change you can do this with PHP by querying a DB for a random
banner (or non random thats up to you to decide) entry to display, each time
you load the page.
If you are wanting to do the "banner change" based on a time interval you
would have to setup some javascript to do this for you, maybe generate it
using php that formerly queried a database of banner entries.
Google: banners +javascript first before posting, there's always an answer
;)
Regards,
Tim
attached mail follows:
> -----Original Message-----
> From: Németh Zoltán [mailto:znemeth
alterationx.hu]
> Sent: Wednesday, February 14, 2007 11:37 AM
> To: Chris Carter
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] Banner rotation with links
>
> 2007. 02. 14, szerda keltezéssel 08.29-kor Chris Carter ezt írta:
> > How can I rotate a banner as well as the link in it within a page using
> PHP.
> > This can be done as a include file php. Anybody please supply some code
> or a
> > link for this.
>
> please go STFW for "banner rotation php script"
>
> greets
> Zoltán Németh
>
Even better, download this free open source application which does it all
for you...
http://www.phpadsnew.com/
-Brad
attached mail follows:
> -----Message d'origine-----
> De : Brad Fuller [mailto:bfuller
cpacampaigns.com]
> Envoyé : mercredi 14 février 2007 17:41
> À : 'Németh Zoltán'; 'Chris Carter'
> Cc : php-general
lists.php.net
> Objet : RE: [PHP] Banner rotation with links
>
> > -----Original Message-----
> > From: Németh Zoltán [mailto:znemeth
alterationx.hu]
> > Sent: Wednesday, February 14, 2007 11:37 AM
> > To: Chris Carter
> > Cc: php-general
lists.php.net
> > Subject: Re: [PHP] Banner rotation with links
> >
> > 2007. 02. 14, szerda keltezéssel 08.29-kor Chris Carter ezt írta:
> > > How can I rotate a banner as well as the link in it within a page
> > > using
> > PHP.
> > > This can be done as a include file php. Anybody please
> supply some
> > > code
> > or a
> > > link for this.
> >
> > please go STFW for "banner rotation php script"
> >
> > greets
> > Zoltán Németh
> >
>
> Even better, download this free open source application which
> does it all for you...
>
> http://www.phpadsnew.com/
>
> -Brad
Yeah, maybe their should be an alternate list for "Where can i find the app
for me to do this" queries :D
Regards,
Tim
attached mail follows:
Hi,
How can I get the object ID number of each Object in PHP (v.5.2) ?
The ID number is the one produced when dumping:
<?php
class A {}
class B {}
$a = new A();
$b = new B();
var_dump($a);
var_dump($b);
?>
=== output:
object(A)#1 (0) {
}
object(B)#2 (0) {
}
I do not want to buffer and parse the dumped string... Is there a nicer way?
-thanks!
attached mail follows:
# eli.hen
gmail.com / 2007-02-14 19:31:00 +0200:
> Hi,
>
> How can I get the object ID number of each Object in PHP (v.5.2) ?
http://cz2.php.net/manual/en/function.spl-object-hash.php
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
attached mail follows:
Roman Neuhauser wrote:
>> How can I get the object ID number of each Object in PHP (v.5.2) ?
>
> http://cz2.php.net/manual/en/function.spl-object-hash.php
Thanks!!! That is exactly what I need... :-)
<?php
class A {}
class B {}
$a = new A();
$b = new B();
var_dump(spl_object_hash($a));
var_dump(spl_object_hash($b));
?>
=== output:
string(32) "eaa76ef5378142caec7b40b56e4b6314"
string(32) "6168ec2b9db13132570a79ef04104e3c"
-thanks!
attached mail follows:
I suspect that's not an "absolute" ID, but just an ID for that
particular dump. So it has no applicability beyond that dump...
On Wed, February 14, 2007 11:31 am, Eli wrote:
> Hi,
>
> How can I get the object ID number of each Object in PHP (v.5.2) ?
>
> The ID number is the one produced when dumping:
> <?php
> class A {}
> class B {}
> $a = new A();
> $b = new B();
> var_dump($a);
> var_dump($b);
> ?>
> === output:
> object(A)#1 (0) {
> }
> object(B)#2 (0) {
> }
>
> I do not want to buffer and parse the dumped string... Is there a
> nicer way?
>
> -thanks!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Every dump of the same node will produce the same #id.
Cloned object, is a separated new object which will have a different id.
The spl_object_hash function produces such an id too (32 hex chars),
which doesn't change if you change the object members.
Richard Lynch wrote:
> I suspect that's not an "absolute" ID, but just an ID for that
> particular dump. So it has no applicability beyond that dump...
attached mail follows:
Hmm.. sorry.. just checked it now, and you're right..
The #id in the dump and the hash given by spl_object_hash() give a
unique ID among the objects instantiated in your process..
If you unset some of the objects, and re-create new instances of them,
you may get the SAME ids you had before..
The better is might be by giving a custom id like:
$ID = md5(microtime());
Eli wrote:
> Every dump of the same node will produce the same #id.
> Cloned object, is a separated new object which will have a different id.
> The spl_object_hash function produces such an id too (32 hex chars),
> which doesn't change if you change the object members.
>
>
> Richard Lynch wrote:
>> I suspect that's not an "absolute" ID, but just an ID for that
>> particular dump. So it has no applicability beyond that dump...
attached mail follows:
At 8:40 PM +0100 2/13/07, Satyam wrote:
>----- Original Message ----- From: "Jon Anderson" <jon
gamingsolutions.ca>
>>The reason is simple:
>>0: No rounding. It's already there. (8.0 doesn't need to be rounded
>>to 8 - it already *is* 8.)
>>1-4: You round down -> 4 of 9 times you round down.
>>5-9: You round up -> 5 of 9 times you round up.
>
>That is not quite correct, there is no such 4 ninths agains 5
>ninths. You round down in the interval from 0 to0.499999999 and you
>round up from 0.5 to 0.9999999. If you substract the .5 from
>0.99999, you get 0.4999999 so it is about the same interval for both.
>
>If there is any difference, and actually there is, is because any
>number is, in reality, truncated, and not rounded, at some point.
>Depending on the number of bits of the mantissa, it might be a long
>way off, but eventually, it will happen, and that one is truncation,
>nor rounding, and if you repeat any calculation involving fractional
>numbers, it will eventually add up to something noticeable.
>
>Actually, there is the further problem that computers actually use
>binary, not decimal, so they cannot represent decimal numbers
>exactly. To offer an example of what I'm talking about, 1/3, which
>results in a never ending 0.333333 is exactly 0.1 in base 3
>arithmetic! Conversely, many 'round' numbers in our decimal
>notation are not 'round' in binary and viceversa. So it is all the
>piling of lots of rounding errors in real-life number
>representations that produce the error, not the mathematics of
>rounding, which actually work in an abstract world of infinitely
>precise number representations (in other words, infinite bits to
>represent any numbers).
>
>Satyam
Satyam and Jon:
Actually, both of you are correct.
The bias in rounding comes from the concept of rounding down for
numbers 0-4 and rounding up for number 5-9. Please, let's take a
critical look at that premise.
For zero, as Jon claims, there is no rounding at all -- you don't do
anything. You can't include zero as one of the conditions that claims
to do something when it doesn't do anything. It doesn't do anything
to the data at all! So, to include zero in a rounding scheme is
fundamentally flawed. Satyam, put your objections on hold for a
moment and consider.
For values one to four, you round down. So, you have four conditions
where you actually do something to the data, you round down.
For values five to nine, you round up. So, you have five conditions
where you actually do something to the data, you round up.
If you do anything four times one way and five times the other,
you're going to introduce a bias.
So, how do you get around this?
One way is to use Statistical (Stochastic) rounding. It singles out
five as being the culprit for this bias. It uses the even/odd rule of
the preceding digit to determine which direction to round 5. If the
value is even, then it rounds up -- whereas if the value is odd, then
it rounds down. (or reverse the rounding, it doesn't matter as long
as you are consistent).
For all other values (1-4 and 6-9, note four each direction) the
typical rounding is observed.
Examples of it at work:
0.5 -> 1 (zero is treated as even -- see below *)
1.5 - >1
2.5 -> 3
3.5 -> 3
4.5 -> 5
5.5 ->5
6.5 -> 7
7.5 -> 7
8.5 -> 9
9.5 - 9
From this distribution (actually all you'll ever need to prove this),
you can see we have just as many cases that round up as we do that
round down -- thus, the aforementioned rounding bias has been
reduced. The negative range is just a mirror image.
Now, one can try to pump this algorithm through a PHP loop to see the
difference (as I've tried) but you'll find that there are rounding
errors (due to what Satyam said about computers representing decimal
numbers exactly) that will prohibit making the algorithm work as
described.
For example, the "built-in" functions, such as intval(), do not work
the way you might expect them to work. Try using this statement:
$t =intval(($number - intval($number)) * 10);
It works fine if the number is 89441560.5 -- it returns 5.
However, if the number is 139690837.6 -- returns 5 instead of 6.
And the list goes on of examples where the result isn't quite what's expected.
If you look deeper into this, you'll find the rounding problem
doesn't really have a solution, but rather it's a compromise. I'm
sure that Rasmus Lendorf could shed some light on this -- remember
the "When is z != z?" argument I started many moons ago? I think this
is along the same lines.
Perhaps the round() function takes all this into account, but I don't
know and therein lies my suspicion.
Cheers,
tedd
*By definition, any number that can be divided by two and leaves no
remainder is even. Some say that the value is undefined, but for sake
of this argument, it's considered even. Besides, symmetry in nature
is more desirable.
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
At 6:22 PM -0600 2/13/07, Richard Lynch wrote:
>
>The most efficient way is "Don't do that." :-)
>
>Simply loop through the results and do whatever you want to do with
>them, and don't put them into an array at all.
>
>This question has appeared before, and usually breaks down to one of
>these scenarios:
>
>#1
snip 1
>
>#2
snip 2
>
>#2 does occasionally have an exception to the rule, where the SQL
>query is nasty and the PHP is fast and easy, but that's awfully rare.
>
>
How about scenario #3: I wish to output my data in (for example)
three columns, as a phone book does. To make the example simple,
assume 15 data points. I wish the output to look like
1 6 11
2 7 12
3 8 13
4 9 14
5 10 15
So when I'm outputting row 1, I need data points 1, 6, and 11. Isn't
it easier to generate the query, put in array, and output the rows
from the array? Keep in mind, the number of data points might be
variable, the constraints being n columns with approximately the same
number of data point in each column.
-----===== Bill =====-----
--
The secret of life is...I can't tell you. It's a secret.
attached mail follows:
> -----Original Message-----
> From: Bill Guion [mailto:bguion
comcast.net]
> Sent: Wednesday, February 14, 2007 12:35 PM
> To: PHP-General
> Subject: Re: [PHP] Getting mysql_query results into an array
>
> At 6:22 PM -0600 2/13/07, Richard Lynch wrote:
>
> >
> >The most efficient way is "Don't do that." :-)
> >
> >Simply loop through the results and do whatever you want to do with
> >them, and don't put them into an array at all.
> >
> >This question has appeared before, and usually breaks down to one of
> >these scenarios:
> >
> >#1
>
> snip 1
>
> >
> >#2
>
> snip 2
>
> >
> >#2 does occasionally have an exception to the rule, where the SQL
> >query is nasty and the PHP is fast and easy, but that's awfully rare.
> >
> >
>
> How about scenario #3: I wish to output my data in (for example)
> three columns, as a phone book does. To make the example simple,
> assume 15 data points. I wish the output to look like
>
> 1 6 11
> 2 7 12
> 3 8 13
> 4 9 14
> 5 10 15
>
> So when I'm outputting row 1, I need data points 1, 6, and 11. Isn't
> it easier to generate the query, put in array, and output the rows
> from the array? Keep in mind, the number of data points might be
> variable, the constraints being n columns with approximately the same
> number of data point in each column.
Instead of creating a whole array, why not just move the pointer of the
result set? Like so (the example prints rows in reverse order):
http://us3.php.net/manual/en/function.mysql-data-seek.php
attached mail follows:
Bill Guion wrote:
> At 6:22 PM -0600 2/13/07, Richard Lynch wrote:
>
>>
>> The most efficient way is "Don't do that." :-)
>>
>> Simply loop through the results and do whatever you want to do with
>> them, and don't put them into an array at all.
>>
>> This question has appeared before, and usually breaks down to one of
>> these scenarios:
>>
>> #1
>
> snip 1
>
>>
>> #2
>
> snip 2
>
>>
>> #2 does occasionally have an exception to the rule, where the SQL
>> query is nasty and the PHP is fast and easy, but that's awfully rare.
>>
>>
>
> How about scenario #3: I wish to output my data in (for example) three
> columns, as a phone book does. To make the example simple, assume 15
> data points. I wish the output to look like
>
> 1 6 11
> 2 7 12
> 3 8 13
> 4 9 14
> 5 10 15
>
> So when I'm outputting row 1, I need data points 1, 6, and 11. Isn't it
> easier to generate the query, put in array, and output the rows from the
> array? Keep in mind, the number of data points might be variable, the
> constraints being n columns with approximately the same number of data
> point in each column.
it not beyond the possible to output 3 blocks in series and use CSS to
visually style the information according to the N-column layout you desire.
given that what you describe is pure layout I don't think it hold up in theory,
in practice your are often going to want to use a table to avoid a bunch of headaches
... then again a fancy bit of javascript could be used to rewrite the dom
on the client side (i.e. build an N-column table/layout using blocks/elements of information
that has been output serially ... then again that raises the issue of usability
with regard to using javascript.
.. just a thought.
>
> -----===== Bill =====-----
attached mail follows:
> > How about scenario #3: I wish to output my data in (for example)
> > three columns, as a phone book does. To make the example simple,
> > assume 15 data points. I wish the output to look like
> >
> > 1 6 11
> > 2 7 12
> > 3 8 13
> > 4 9 14
> > 5 10 15
> >
> > So when I'm outputting row 1, I need data points 1, 6, and 11. Isn't
> > it easier to generate the query, put in array, and output the rows
> > from the array? Keep in mind, the number of data points might be
> > variable, the constraints being n columns with approximately the same
> > number of data point in each column.
>
>
>
> Instead of creating a whole array, why not just move the pointer of the
> result set? Like so (the example prints rows in reverse order):
>
> http://us3.php.net/manual/en/function.mysql-data-seek.php
Another solution to the example above would be something like this:
<table>
<tr>
<td>
<table>
<?
$i=0;
for($j=1;$j<=15;$j++){
?><tr><td><?= $j ?></td></tr><?
$i++;
if($i==5){
?></table></td><td><table><?
$i=0;
}
}
?>
</table>
</td>
</tr>
</table>
The result is a table with 3 cells, each cell containing a table with 5
rows. The iterator closes the table and cell, and starts a new one every 5
records. A bit of tweaking and some additional logic could make it dynamic.
:B
attached mail follows:
On Tue, February 13, 2007 8:22 pm, Robert Cummings wrote:
> On Tue, 2007-02-13 at 18:22 -0600, Richard Lynch wrote:
>> #2
>> loop through mysql result set to build $array
>> perform some kind of calculation upon $array
>>
>> In this case, it's USUALLY much more efficient to write an SQL query
>> to perform the calculation.
>>
>> Databases are highly optimized for this kind of thing, and very
>> efficient at it.
>> PHP is a generalized programming language, and not so efficient for
>> this kind of task.
>>
>> #2 does occasionally have an exception to the rule, where the SQL
>> query is nasty and the PHP is fast and easy, but that's awfully
>> rare.
>
> I hear this all the time that the database should do as much as
> possible
> "it's highly optimized" yadda yadda. I'm going to go out on a limb and
> say that in a heavily loaded system, shoving all the work into the
> primary bottleneck is a bad idea. 100 workers make light work, and
> that
> would be the inherent power in horizontal scalability. Databases do
> not
> scale well horizontally, machines loaded with Apache and PHP do,
> especially when each machine doesn't expect the database server to do
> all the work. In fact, I'd wager queries involving joins are another
> bane on horizontal scalability since now the tables are forced to
> reside
> on the same machine.
>
> I could be completely wrong, I've never worked on an extremely loaded
> server, but I get a tick every time someone says "shove all the work
> into the query", and that usually happens when something doesn't feel
> right :)
For the 0.1% of people who can't get enough performance out of their
web farm and "single" DB, there are several interesting possibilities
for factoring or distributed processing, including scaling
horizontally with PHP but they also can consider segmenting the DB in
various ways, or even replacing the DB with something faster/lighter
or something that scales horizontally for the most-used functionality
(e.g., MCache for session management).
The "right" answer for that 0.1% isn't gonna be covered in a 10-second
answer on PHP-General, though, as it's almost-for-sure going to depend
on their application needs more than any off-the-rack answer.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Wed, February 14, 2007 11:34 am, Bill Guion wrote:
> At 6:22 PM -0600 2/13/07, Richard Lynch wrote:
>
>>
>>The most efficient way is "Don't do that." :-)
>>
>>Simply loop through the results and do whatever you want to do with
>>them, and don't put them into an array at all.
>>
>>This question has appeared before, and usually breaks down to one of
>>these scenarios:
>>
>>#1
>
> snip 1
>
>>
>>#2
>
> snip 2
>
>>
>>#2 does occasionally have an exception to the rule, where the SQL
>>query is nasty and the PHP is fast and easy, but that's awfully rare.
>>
>>
>
> How about scenario #3: I wish to output my data in (for example)
> three columns, as a phone book does. To make the example simple,
> assume 15 data points. I wish the output to look like
>
> 1 6 11
> 2 7 12
> 3 8 13
> 4 9 14
> 5 10 15
>
> So when I'm outputting row 1, I need data points 1, 6, and 11. Isn't
> it easier to generate the query, put in array, and output the rows
> from the array? Keep in mind, the number of data points might be
> variable, the constraints being n columns with approximately the same
> number of data point in each column.
The original question was "what's most efficient".
For a small number of items (like 15) the efficiency probably isn't
all that big a deal...
For a large number, however, you still might be better off with a
"select count(*)" query, and then use some sort of modulus operator
with a row number in the DB to order the data. Or maybe not, as you
won't have an index on that, most likely... All depends on your
hardware, your data, your situation...
All that said, outputting them as div/span tags might actually be most
efficient, and play a trick with CSS to get them aligned the way you
want, even though they appear in the original order within the raw
HTML output.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Hello!
The PHP Development Team would like to announce the immediate release of
PHP 4.4.5.
This release is a stability and security enhancement of the 4.4.X
branch, and all users are strongly encouraged to upgrade to it as soon
as possible.
A separate release announcement is also available. For changes in PHP
4.4.5 since PHP 4.4.4, please consult the PHP 4 ChangeLog.
Release Announcement: http://www.php.net/release_4_4_5.php
Downloads: http://www.php.net/downloads.php#v4
Changelog: http://www.php.net/ChangeLog-4.php#4.4.5
regards,
Derick
--
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org
attached mail follows:
Hello,
I have a page the contains two insert statements.
$insert1 = "INSERT INTO table1 (
debit_card,
card_type,
card_number,
exp_date,
payment_amount,
cvv_number,
first_name,
middle_name,
last_name,
address_1,
address_2,
city,
zip_code,
zip_4,
phone_number,
fax_number,
email_address,
receipt,
comments,
date_request_received,
employee_received_call,
research_phase_date,
research_phase_user,
submit_phase_date,
submit_phase_user,
status_code,
state_code)
VALUES (
'$debit_card',
'$card_type',
'$card_number',
'$exp_date',
'$amount',
'$cvv',
'$cc_first',
'$cc_middle',
'$cc_last',
'$cc_address_1',
'$cc_address_2',
'$cc_city',
'$cc_zip',
'$cc_zip_4',
'$cc_phone_number',
'$cc_fax_number',
'$cc_email_address',
'$receipt',
'$cc_comments',
'$create_date',
'$create_user',
'$research_date',
'$research_user',
'$submit_date',
'$submit_user',
'$status_code',
'$cc_state')";
mssql_query($insert1) or die ("Query failed: <br
/>".mssql_get_last_message());
$insert2 = "INSERT INTO table2 (
credit_card_id,
case_number,
comments)
VALUES (
'card_id',
'$case',
'$comments')";
mssql_query($insert2) or die ("Query failed: <br
/>".mssql_get_last_message());
echo "Insert complete";
On my second insert statement, please note "credit_card_id". This is an
auto_increment column in table1. What I need to do is pull the value of
"credit_card_id" from the newly inserted row from insert1 and put that value
in a variable to assign it to "credit_card_id" in insert2.
I hope that wasn't too confusing.
attached mail follows:
On Wed, 2007-02-14 at 13:20 -0500, Dan Shirah wrote:
> Hello,
>
> On my second insert statement, please note "credit_card_id". This is an
> auto_increment column in table1. What I need to do is pull the value of
> "credit_card_id" from the newly inserted row from insert1 and put that value
> in a variable to assign it to "credit_card_id" in insert2.
Search the web for last_insert_id()
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Dan Shirah wrote:
> On my second insert statement, please note "credit_card_id". This is an
> auto_increment column in table1. What I need to do is pull the value of
> "credit_card_id" from the newly inserted row from insert1 and put that
> value
> in a variable to assign it to "credit_card_id" in insert2.
Just append "; SELECT 
identity" to the first query, then fetch the
result as normal.
Arpad
attached mail follows:
> -----Message d'origine-----
> De : Dan Shirah [mailto:mrsquash2
gmail.com]
> Envoyé : mercredi 14 février 2007 19:20
> À : php-general
> Objet : [PHP] Retrieve value of newly inserted row.
>
> Hello,
>
> I have a page the contains two insert statements.
>
>
> $insert1 = "INSERT INTO table1 (
> debit_card,
> card_type,
> card_number,
> exp_date,
> payment_amount,
> cvv_number,
> first_name,
> middle_name,
> last_name,
> address_1,
> address_2,
> city,
> zip_code,
> zip_4,
> phone_number,
> fax_number,
> email_address,
> receipt,
> comments,
> date_request_received,
> employee_received_call,
> research_phase_date,
> research_phase_user,
> submit_phase_date,
> submit_phase_user,
> status_code,
> state_code)
> VALUES (
> '$debit_card',
> '$card_type',
> '$card_number',
> '$exp_date',
> '$amount',
> '$cvv',
> '$cc_first',
> '$cc_middle',
> '$cc_last',
> '$cc_address_1',
> '$cc_address_2',
> '$cc_city',
> '$cc_zip',
> '$cc_zip_4',
> '$cc_phone_number',
> '$cc_fax_number',
> '$cc_email_address',
> '$receipt',
> '$cc_comments',
> '$create_date',
> '$create_user',
> '$research_date',
> '$research_user',
> '$submit_date',
> '$submit_user',
> '$status_code',
> '$cc_state')";
> mssql_query($insert1) or die ("Query failed: <br
> />".mssql_get_last_message());
>
>
> $insert2 = "INSERT INTO table2 (
> credit_card_id,
> case_number,
> comments)
> VALUES (
> 'card_id',
> '$case',
> '$comments')";
> mssql_query($insert2) or die ("Query failed: <br
> />".mssql_get_last_message());
>
> echo "Insert complete";
>
>
>
>
>
> On my second insert statement, please note "credit_card_id".
> This is an
> auto_increment column in table1. What I need to do is pull
> the value of "credit_card_id" from the newly inserted row
> from insert1 and put that value in a variable to assign it to
> "credit_card_id" in insert2.
>
>
>
> I hope that wasn't too confusing.
http://cz2.php.net/manual/en/function.mysql-insert-id.php
>
attached mail follows:
On Wed, 2007-02-14 at 13:26 -0500, Robert Cummings wrote:
> On Wed, 2007-02-14 at 13:20 -0500, Dan Shirah wrote:
> > Hello,
> >
> > On my second insert statement, please note "credit_card_id". This is an
> > auto_increment column in table1. What I need to do is pull the value of
> > "credit_card_id" from the newly inserted row from insert1 and put that value
> > in a variable to assign it to "credit_card_id" in insert2.
>
> Search the web for last_insert_id()
Never mind, just noticed you are using MS SQL.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
> -----Message d'origine-----
> De : Tim [mailto:user
internet46.fr]
> Envoyé : mercredi 14 février 2007 19:28
> À : 'Dan Shirah'; 'php-general'
> Objet : RE: [PHP] Retrieve value of newly inserted row.
>
>
>
> > -----Message d'origine-----
> > De : Dan Shirah [mailto:mrsquash2
gmail.com] Envoyé : mercredi 14
> > février 2007 19:20 À : php-general Objet : [PHP] Retrieve value of
> > newly inserted row.
> >
> > Hello,
> >
> > I have a page the contains two insert statements.
> >
> >
> > $insert1 = "INSERT INTO table1 (
> > debit_card,
> > card_type,
> > card_number,
> > exp_date,
> > payment_amount,
> > cvv_number,
> > first_name,
> > middle_name,
> > last_name,
> > address_1,
> > address_2,
> > city,
> > zip_code,
> > zip_4,
> > phone_number,
> > fax_number,
> > email_address,
> > receipt,
> > comments,
> > date_request_received,
> > employee_received_call,
> > research_phase_date,
> > research_phase_user,
> > submit_phase_date,
> > submit_phase_user,
> > status_code,
> > state_code)
> > VALUES (
> > '$debit_card',
> > '$card_type',
> > '$card_number',
> > '$exp_date',
> > '$amount',
> > '$cvv',
> > '$cc_first',
> > '$cc_middle',
> > '$cc_last',
> > '$cc_address_1',
> > '$cc_address_2',
> > '$cc_city',
> > '$cc_zip',
> > '$cc_zip_4',
> > '$cc_phone_number',
> > '$cc_fax_number',
> > '$cc_email_address',
> > '$receipt',
> > '$cc_comments',
> > '$create_date',
> > '$create_user',
> > '$research_date',
> > '$research_user',
> > '$submit_date',
> > '$submit_user',
> > '$status_code',
> > '$cc_state')";
> > mssql_query($insert1) or die ("Query failed: <br
> > />".mssql_get_last_message());
> >
> >
> > $insert2 = "INSERT INTO table2 (
> > credit_card_id,
> > case_number,
> > comments)
> > VALUES (
> > 'card_id',
> > '$case',
> > '$comments')";
> > mssql_query($insert2) or die ("Query failed: <br
> > />".mssql_get_last_message());
> >
> > echo "Insert complete";
> >
> >
> >
> >
> >
> > On my second insert statement, please note "credit_card_id".
> > This is an
> > auto_increment column in table1. What I need to do is pull
> the value
> > of "credit_card_id" from the newly inserted row from
> insert1 and put
> > that value in a variable to assign it to "credit_card_id"
> in insert2.
> >
> >
> >
> > I hope that wasn't too confusing.
>
> http://cz2.php.net/manual/en/function.mysql-insert-id.php
Sorry my eyes played some tricks on me ragarding mysql/mssql refer to
Robert's post on looking up "last insert id".
Regards,
Tim
attached mail follows:
On Wed, 2007-02-14 at 19:34 +0100, Tim wrote:
> >
> > -----Message d'origine-----
> > De : Tim [mailto:user
internet46.fr]
> >
> > > I hope that wasn't too confusing.
> >
> > http://cz2.php.net/manual/en/function.mysql-insert-id.php
>
> Sorry my eyes played some tricks on me ragarding mysql/mssql refer to
> Robert's post on looking up "last insert id".
No, no, I had the same tricksies played on me too :)
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Sorry, I wasn't trying to fool you, I promise! :)
Arpad,
From looking on the web (MSDN) I found the 
identity and the explanation of
what it is, but MS's "example" is horrible and does not show a good context
for using this function. Could you elaborate more on its use?
On 2/14/07, Robert Cummings <robert
interjinn.com> wrote:
>
> On Wed, 2007-02-14 at 19:34 +0100, Tim wrote:
> > >
> > > -----Message d'origine-----
> > > De : Tim [mailto:user
internet46.fr]
> > >
> > > > I hope that wasn't too confusing.
> > >
> > > http://cz2.php.net/manual/en/function.mysql-insert-id.php
> >
> > Sorry my eyes played some tricks on me ragarding mysql/mssql refer to
> > Robert's post on looking up "last insert id".
>
> No, no, I had the same tricksies played on me too :)
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
>
>
attached mail follows:
> >From looking on the web (MSDN) I found the 
identity and the explanation
> of
> what it is, but MS's "example" is horrible and does not show a good
> context
> for using this function. Could you elaborate more on its use?
$q = mssql_query("INSERT INTO TableName(...) VALUES(...) SELECT
LAST_INSERT_ID=
IDENTITY");
$r = mssql_fetch_assoc($q);
HTH,
Brad
attached mail follows:
Brad Fuller wrote:
>> >From looking on the web (MSDN) I found the 
identity and the explanation
>> of
>> what it is, but MS's "example" is horrible and does not show a good
>> context
>> for using this function. Could you elaborate more on its use?
>
> $q = mssql_query("INSERT INTO TableName(...) VALUES(...) SELECT
> LAST_INSERT_ID=
IDENTITY");
> $r = mssql_fetch_assoc($q);
>
>
> HTH,
>
> Brad
>
Might look at this
http://us3.php.net/manual/en/function.mssql-query.php#46026
--
Enjoy,
Jim Lucas
Different eyes see different things. Different hearts beat on different
strings. But there are times for you and me when all such things agree.
- Rush
attached mail follows:
Hello Gurus,
Newbie to PHP here. I have a list of categories, as checkboxes, that I
would like a user to be able to choose from. There are literally
hundreds of categories, however most of them are children categories. I
obviously don't want to display all of the categories at once to the
user as that would be unwieldy. What I would like is for the user to
select the desired checkbox and then all the children categories would
display. The categories are setup as follows:
Basketball and Football are the root categories. Once one of these are
selected, it would be expand to show the conferences and once the
conference is selected it would expand to show the teams.
Example:
Basketball
ACC
Big 10
Wisconisin
Illinois
Michigan
.
.
.
Big 12
ACC
.
.
.
Thanks In Advance,
Brian
This email and any files transmitted with it are confidential and <