[PHP] Structured Code vs. Performance

2007-11-29 Thread news_yodpeirs
I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a separate file and include it if required, putting it in a constant-dependent

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 08:56 +0100, [EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a separate file

RE: [PHP] Structured Code vs. Performance

2007-11-29 Thread Tomi Kaistila
I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a separate file and include it if required, putting it in a

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Chris
[EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a separate file and include it if required, putting it

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
[EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a separate file and include it if required, putting

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
Tomi Kaistila wrote: ... You can avoid duplication by only using require_once or include_once. PHP indeed require_once() and include_once() help with maintainability but it should be mentioned that if you are going to use an op-code cache (as Rob Cummings mentioned also) then it is highly

Re: [PHP] Should I put pictures into a database?

2007-11-29 Thread Robin Vickery
On 28/11/2007, AmirBehzad Eslami [EMAIL PROTECTED] wrote: On Wednesday 21 November 2007 03:14:43 Ronald Wiplinger wrote: I have an application, where I use pictures. The size of the picture is about 90kB and to speed up the preview, I made a thumbnail of each picture which is about 2.5 to

Re: [PHP] Instantiate phpmailer in a separate class?

2007-11-29 Thread Mike Yrabedra
on 11/29/07 1:53 AM, Jochem Maas at [EMAIL PROTECTED] wrote: Mike Yrabedra wrote: Hello, I want to have a class send some emails. I wanted to use the excellent phpMailer class to do this. What is the proper way to use the phpMailer class from within a method of a separate class?

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Stut
Jochem Maas wrote: [EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a separate file and include it if

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
Stut wrote: Jochem Maas wrote: [EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a separate file and

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Stut
Jo chem baas wrote: Stut wrote: Jochem Maas wrote: [EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each code-portion in a

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
Stut wrote: Jo chem baas wrote: Stut wrote: Jochem Maas wrote: [EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance: Putting each

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Stut
Jochem Maas wrote: Stut wrote: Jo chem baas wrote: Stut wrote: Jochem Maas wrote: [EMAIL PROTECTED] wrote: I got different portions of code only used for certain purposes (who don't ;-)?). But what, in your opinion (better: in your experience) would be the best regarding script-performance:

[PHP] Re: Structured Code vs. Performance

2007-11-29 Thread news_yodpeirs
Thank you for the answers. My abstract: Use separate files for separate code. Easy to maintain, no real loss in performance. That's fine, as I'm just doing so (like if I need a database abstraction, I include dbas.php and if dbas.php needs some miscellaneous functionality, it includes

[PHP] Functions with Static Variables vs. Classes

2007-11-29 Thread news_yodpeirs
For some simple applications I use a function to collect values in a static variable and to return them when called in a special way, just like this (fairly senseless) example: function example($elem='') { static $store = array(); if (!func_num_args()) return($store); ... do

Re: [PHP] Curl doesn't handle memory stream

2007-11-29 Thread Peter Smit
On Nov 27, 2007 11:43 PM, Peter Smit [EMAIL PROTECTED] wrote: Hello, I've got quite a strange problem with the curl library. The following code does output Content||\Content instead of Content|example.orgoutput|\Content $c = curl_init(http://example.com;); $st = fopen(php://memory, r+);

[PHP] variable array name

2007-11-29 Thread Mark Head
I seem to be having a problem in assigning a value to an array where the array is called dynamically. e.g. the physical name for the array is my_array, so: my_array[1] = test; works fine. $array_name = my_array; $array_name[1] = test; does not work. I have tried $$array_name[1] = test; but to

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Paul Scott
On Thu, 2007-11-29 at 13:51 +0100, Jochem Maas wrote: okay, but I was just paraphrasing the man Rasmus, although I admit I may have misinterpreted (or misundersstood the 'why') - thought I pretty sure he has written on a number of occasions that code like the following sucks for op-code

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
Stut wrote: Jochem Maas wrote: Stut wrote: Jo chem baas wrote: ^- wtf happened here? :-) it's quite funny if you know dutch :-) ... Whether there is conditional definition or not, the opcode cache will look the same. The reason for this is that function and class definitions

[PHP] Variable Names

2007-11-29 Thread Shaun
Hi, I seem to be having a problem in assigning a value to an array where the array is called dynamically. e.g. the physical name for the array is my_array, so: my_array[1] = test; works fine. $array_name = my_array; $array_name[1] = test; does not work. I have tried $$array_name[1] = test; but

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Jochem Maas
[EMAIL PROTECTED] wrote: Just to be curious: when something like if (defined('FOO') FOO) { class foo{}; function foo(){}; } is parsed and FOO is not defined, will the code inside be parsed nevertheless? Or is anything inside skipped, leading to a (fragments of microseconds)

AW: [PHP] Variable Names

2007-11-29 Thread Frank Ruske
?php $foo = my_array; $$foo = array(0 = bar); var_dump($my_array); ? array(1) { [0]= string(3) bar } Regards Frank -Ursprüngliche Nachricht- Von: Shaun [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 29. November 2007 13:57 An: php-general@lists.php.net Betreff: [PHP] Variable Names

AW: [PHP] Variable Names

2007-11-29 Thread Frank Ruske
?php $foo = my_array; $$foo = array(0 = bar); var_dump($my_array); ? array(1) { [0]= string(3) bar } Regards Frank -Ursprüngliche Nachricht- Von: Shaun [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 29. November 2007 13:57 An: php-general@lists.php.net Betreff: [PHP] Variable Names

[PHP] Re: Variable Names

2007-11-29 Thread news_yodpeirs
The manual says: In order to use variable variables with arrays, you have to resolve an ambiguity problem. That is, if you write $$a[1] then the parser needs to know if you meant to use $a[1] as a variable, or if you wanted $$a as the variable and then the [1] index from that variable. The

Re: [PHP] Functions with Static Variables vs. Classes

2007-11-29 Thread Zoltán Németh
2007. 11. 29, csütörtök keltezéssel 14.18-kor [EMAIL PROTECTED] ezt írta: For some simple applications I use a function to collect values in a static variable and to return them when called in a special way, just like this (fairly senseless) example: function example($elem='') { static

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Stut
Jochem Maas wrote: Stut wrote: Jochem Maas wrote: Stut wrote: Jo chem baas wrote: ^- wtf happened here? :-) it's quite funny if you know dutch :-) Pass. Looking back it looks like it happened one of the times I replied. Didn't do it on purpose, honest! ;) Whether there is

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread news_yodpeirs
Just to be curious: when something like if (defined('FOO') FOO) { class foo{}; function foo(){}; } is parsed and FOO is not defined, will the code inside be parsed nevertheless? Or is anything inside skipped, leading to a (fragments of microseconds) faster handling of the code? Thus to

Re: [PHP] Functions with Static Variables vs. Classes

2007-11-29 Thread news_yodpeirs
From: Zoltán Németh [EMAIL PROTECTED] function example($elem='') { static $store = array(); AFAIK the above line should cause an error on the second run of the function, as you declare the same static variable for the second time. or am I wrong? I think so - otherwise static

Re: [PHP] Functions with Static Variables vs. Classes

2007-11-29 Thread Jochem Maas
[EMAIL PROTECTED] wrote: From: Zoltán Németh [EMAIL PROTECTED] function example($elem='') { static $store = array(); AFAIK the above line should cause an error on the second run of the function, as you declare the same static variable for the second time. or am I wrong? indeed you

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread news_yodpeirs
they have a word very suitable to this situation in dutch 'mierenneuken', personally I'd stick with pretty girls. OT: Couldn't translate that in german, the nearest approach seems to be Haarspalterei but unfortunately for me this seems not to match the situation. And it doesn't meet pretty

[PHP] One more data formatting question

2007-11-29 Thread Jon Westcot
Hi all: I'm trying to parse out some HTML code back into regular string values and I keep getting tripped up by the non-breaking space value (nbsp;). I see that html_decode_entities() can be used to convert this back to a viewable space, but the documentation tells me that the space value

Re: [PHP] Dynamic Display of Images Stored in DB

2007-11-29 Thread David Giragosian
On 11/28/07, Chris [EMAIL PROTECTED] wrote: In my solution, I use two scripts. One for showing the image true size and another for generating a thumbnail -- I may be wrong, but I think it's better to generate a thumbnail as needed on the fly than it is to store both images (large and

Re: [PHP] problem with url_fopen on free hosting environment

2007-11-29 Thread Samuel Vogel
Ok, I did find a solution by accident. I just blocked all tcp requests on port 80 and 443 comming from my own outside IP. Since I have a couple of servers, I just dropped the following into rc.local on all of them: # Blocking url_fopen requests ownip=`curl -s http://checkip.dyndns.org | awk

Re: [PHP] variable array name

2007-11-29 Thread Daniel Brown
On Nov 29, 2007 7:47 AM, Mark Head [EMAIL PROTECTED] wrote: I seem to be having a problem in assigning a value to an array where the array is called dynamically. e.g. the physical name for the array is my_array, so: my_array[1] = test; works fine. $array_name = my_array; $array_name[1] =

Re: [PHP] One more data formatting question

2007-11-29 Thread T . Lensselink
On Thu, 29 Nov 2007 07:53:56 -0700, Jon Westcot [EMAIL PROTECTED] wrote: Hi all: I'm trying to parse out some HTML code back into regular string values and I keep getting tripped up by the non-breaking space value ( ). I see that html_decode_entities() can be used to convert this back

[PHP] Re: One more data formatting question

2007-11-29 Thread news_yodpeirs
How about $foo = str_replace('nbsp;','',$foo); ? Or could there be an 'nbsp;' in a context where it shouldn't be replaced? Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread T . Lensselink
On Thu, 29 Nov 2007 14:54:43 +0100, Jochem Maas [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Just to be curious: when something like if (defined('FOO') FOO) { class foo{}; function foo(){}; } is parsed and FOO is not defined, will the code inside be parsed nevertheless? Or is

Re: [PHP] One more data formatting question [SOLVED]

2007-11-29 Thread Jon Westcot
Hi: Thanks for the answer! That worked exactly as I needed it to work! Jon - Original Message - From: T.Lensselink [EMAIL PROTECTED] To: Jon Westcot [EMAIL PROTECTED] Cc: PHP General php-general@lists.php.net Sent: Thursday, November 29, 2007 8:17 AM Subject: Re: [PHP] One

Re: [PHP] Curl doesn't handle memory stream

2007-11-29 Thread Nathan Nobbe
On Nov 29, 2007 7:56 AM, Peter Smit [EMAIL PROTECTED] wrote: On Nov 27, 2007 11:43 PM, Peter Smit [EMAIL PROTECTED] wrote: Hello, I've got quite a strange problem with the curl library. The following code does output Content||\Content instead of Content|example.orgoutput|\Content

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Larry Garfield
On Thursday 29 November 2007, Jochem Maas wrote: okay, but I was just paraphrasing the man Rasmus, although I admit I may have misinterpreted (or misundersstood the 'why') - thought I pretty sure he has written on a number of occasions that code like the following sucks for op-code caches and

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 12:13 +, Stut wrote: Not ;). There is no such thing as a compile-time definition in PHP. There certainly is... ?php if( !function_exists( 'file_put_contents' ) ) { $def = _ function file_put_contents ( \$filename, \$data,

Re: [PHP] Curl doesn't handle memory stream

2007-11-29 Thread Peter Smit
On Nov 29, 2007 5:18 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: On Nov 29, 2007 7:56 AM, Peter Smit [EMAIL PROTECTED] wrote: On Nov 27, 2007 11:43 PM, Peter Smit [EMAIL PROTECTED] wrote: Hello, I've got quite a strange problem with the curl library. The following code does

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 16:49 +, Stut wrote: Robert Cummings wrote: On Thu, 2007-11-29 at 12:13 +, Stut wrote: Not ;). There is no such thing as a compile-time definition in PHP. There certainly is... ?php if( !function_exists( 'file_put_contents' ) ) { $def = _

Re: [PHP] Dynamic Display of Images Stored in DB

2007-11-29 Thread Børge Holen
On Thursday 29 November 2007 06:03:32 Chris wrote: In my solution, I use two scripts. One for showing the image true size and another for generating a thumbnail -- I may be wrong, but I think it's better to generate a thumbnail as needed on the fly than it is to store both images (large

Re: [PHP] Structured Code vs. Performance

2007-11-29 Thread Stut
Robert Cummings wrote: On Thu, 2007-11-29 at 12:13 +, Stut wrote: Not ;). There is no such thing as a compile-time definition in PHP. There certainly is... ?php if( !function_exists( 'file_put_contents' ) ) { $def = _ function file_put_contents (

[PHP] Glob

2007-11-29 Thread Tom Chubb
Please can someone help me understand the following: I have 4 images with a .jpg extension in a folder. The following reads all four: $files = glob(thumbs/{*.gif,*.jpg,},GLOB_BRACE); All good, however, I noticed that if the extension is in capital letters, eg .JPG it doesn't work. Apparently this

[PHP] dump a class

2007-11-29 Thread Alex Toro
Hello, I would like to know why when I print_r or var_dump an object I get the private properties. I give you an example: ?php class test { private $myPrivate = 'topsecret'; } $myTest = new test(); #echo $myTest-myPrivate; // Fatal error: Cannot access private property test::$myPrivate

Re: [PHP] Glob

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 17:19 +, Tom Chubb wrote: Please can someone help me understand the following: I have 4 images with a .jpg extension in a folder. The following reads all four: $files = glob(thumbs/{*.gif,*.jpg,},GLOB_BRACE); All good, however, I noticed that if the extension is in

Re: [PHP] Glob

2007-11-29 Thread Tom Chubb
On 29/11/2007, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-11-29 at 17:19 +, Tom Chubb wrote: Please can someone help me understand the following: I have 4 images with a .jpg extension in a folder. The following reads all four: $files =

Re: [PHP] dump a class

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 18:16 +0100, Alex Toro wrote: Hello, I would like to know why when I print_r or var_dump an object I get the private properties. I give you an example: ?php class test { private $myPrivate = 'topsecret'; } $myTest = new test(); #echo $myTest-myPrivate;

[PHP] WSDL Question

2007-11-29 Thread Jonathan Pitcher
For the lasts day I have been fighting with PHP, and WSDL calls to a thrid party provider. Here is what the call needs to look like: SOAP-ENV:Body ns1:ModifyOrganizationRequest ns1:accountIdentifier ns1:accountroot/ns1:account /ns1:accountIdentifier

[PHP] Join question

2007-11-29 Thread tedd
Hi gang: I'm trying to understand joins, Here's the situation. I have two tables (user1, user2) in one database: The common field between the two tables is username. I want to take fields login and password from user2 and populate the same fields in user1. Currently, the table user1 has

Re: [PHP] Join question

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 15:41 -0500, tedd wrote: Hi gang: I'm trying to understand joins, Here's the situation. I have two tables (user1, user2) in one database: The common field between the two tables is username. I want to take fields login and password from user2 and populate the same

Re: [PHP] Join question

2007-11-29 Thread Daniel Brown
On Nov 29, 2007 3:41 PM, tedd [EMAIL PROTECTED] wrote: Hi gang: Hi, Tedd. PS: Side note -- will safe_mode ON cause problems with this? Negative. I can't see any reason to even think so. All safe_mode does is check the UID/GID of the script to make sure it matches that of the target

Re: [PHP] Join question

2007-11-29 Thread Wolf
tedd [EMAIL PROTECTED] wrote: Hi gang: I'm trying to understand joins, Here's the situation. I have two tables (user1, user2) in one database: The common field between the two tables is username. I want to take fields login and password from user2 and populate the same fields

Re: [PHP] Join question

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 15:47 -0500, Wolf wrote: tedd [EMAIL PROTECTED] wrote: Hi gang: I'm trying to understand joins, Here's the situation. I have two tables (user1, user2) in one database: The common field between the two tables is username. I want to take fields login

[PHP] Clowns à l'Hopital / php-general@lists.php.net : passez à l'action à travers eux !

2007-11-29 Thread =?ISO-8859-1?Q?Catapulte Freeware =AE
Si ce message ne s'affiche pas correctement : retrouvez-le en ligne ici : http://www.clown-hopital.com/interne/CAMPAGNE-N2007.htm Conformément à la loi et aux règlements de la CNIL, les messages de prospection associatifs, politiques, caritatifs ou religieux sont seulement soumis à l'obligation

[PHP] parsing text for special characters

2007-11-29 Thread Adam Williams
I've got an html form, and I have PHP parse the message variables for special characters so when I concatenate all off the message variables together, if a person has put in a ' or other special character, it won't break it when it used in mail($to, MMH Suggestion, $message, $headers); below

Re: [PHP] parsing text for special characters

2007-11-29 Thread mike
On 11/29/07, Adam Williams [EMAIL PROTECTED] wrote: I've got an html form, and I have PHP parse the message variables for special characters so when I concatenate all off the message variables together, if a person has put in a ' or other special character, it won't break it when it used in

Re: [PHP] Join question

2007-11-29 Thread tedd
At 4:11 PM -0500 11/29/07, Robert Cummings wrote: Grep? Loop? A single query will suffice. Also, he doesn't mention wanting to clobber the passwords in table1 when the username does already exist. Cheers, Rob. Table1 passwords and logins are not populated. I want to take those appearing in

Re: [PHP] parsing text for special characters

2007-11-29 Thread Jochem Maas
Adam Williams wrote: I've got an html form, and I have PHP parse the message variables for special characters so when I concatenate all off the message variables together, if a person has put in a ' or other special character, it exactly how are ' and special inside the body of an email

[PHP] Batch process PDF files -- reduce color depth and resolution

2007-11-29 Thread Dan Harrington
Hello, Does anyone know of a good PDF library that works well with PHP (or even not) that can process multi-page PDF files (I am talking thousands) and reduce their color depth from color to black and white as well as reduce the resolution. I'd like it to run well on Linux. Thanks Dan -- PHP

[PHP] Calling parent function with call_user_func_array

2007-11-29 Thread Tommy Baggett
I'm a self-confessed PHP newb (first step towards a cure, right?), so apologies in advance for what may be a basic question. I spent an hour searching for an answer to this and couldn't find one. I found one post that said there was a problem with this in 5.0.3, but it didn't indicate whether

Re: [PHP] Batch process PDF files -- reduce color depth and resolution

2007-11-29 Thread Jochem Maas
Dan Harrington wrote: Hello, Does anyone know of a good PDF library that works well with PHP (or even not) that can process multi-page PDF files (I am talking thousands) and reduce their color depth from color to black and white as well as reduce the resolution. yes and when you learn to

Re: [PHP] Calling parent function with call_user_func_array

2007-11-29 Thread Jochem Maas
Tommy Baggett wrote: I'm a self-confessed PHP newb (first step towards a cure, right?), so if these are your first steps why use php4? php5 has been out for going on 3 years. apologies in advance for what may be a basic question. I spent an hour searching for an answer to this and couldn't

RE: [PHP] Calling parent function with call_user_func_array

2007-11-29 Thread Tommy Baggett
Thanks for taking the time to reply. I'm working on a Wordpress theme and extending one of their existing classes (the Walker class if you're familiar with WP). Since WP still supports PHP4, my theme needs to as well. -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent:

Re: [PHP] Calling parent function with call_user_func_array

2007-11-29 Thread Jochem Maas
Tommy Baggett wrote: Thanks for taking the time to reply. I'm working on a Wordpress theme and extending one of their existing classes (the Walker class if you're familiar with WP). Since WP still supports PHP4, my theme needs to as well. I know WP, don't like the code too much - but you

Re: [PHP] Join question [solved]

2007-11-29 Thread tedd
Hi gang: I found why the JOIN didn't work for me in this instance, which was I needed to create a third table and JOIN what I needed in that table from the other two. My problem was that I was trying to alter one of the tables in the JOIN. While that might be possible it didn't appear so in

Re: [PHP] Calling parent function with call_user_func_array

2007-11-29 Thread Tommy Baggett
On Nov 29, 2007, at 5:30 PM, Jochem Maas wrote: does this work:? call_user_func_array(array(parent,'doSomething'),$args); It doesn't work with PHP 4. I was going to try PHP5 on my development machine but I will need to do some configuration editing first. Here's the exact

Re: [PHP] Dynamic Display of Images Stored in DB

2007-11-29 Thread Chris
Hell, I'm all ok with this method... but does (different) webhotells take into account the amount used with cache/temp files. If so, some check should be used, and if not. Cache it all!, and remove the timelimit, some check for the change of image of course, but that all depends if you

Re: [PHP] Calling parent function with call_user_func_array

2007-11-29 Thread Nathan Nobbe
On Nov 29, 2007 7:22 PM, Tommy Baggett [EMAIL PROTECTED] wrote: Here's the exact code I tried: class Walker_NavBar extends Walker { ... function walk($elements, $to_depth) { $args = func_get_args(); ... // call base class implementation

RE: [PHP] WSDL Question

2007-11-29 Thread Shanon Swafford
I build an array of the list. Then nuSOAP helps when converting it to XML but PHP5 can probably do the same thing. The following builds an array of line_items to put on an order. Then inserts that array into another array containing more order data: for ($i = 1; $i = $num_items; $i++) {

Re: [PHP] Join question

2007-11-29 Thread Crayon Shin Chan
On Friday 30 November 2007, Robert Cummings wrote: That's an amusing statement. I took a peek back in time and noticed that in the past 5 months you've only made two on-topic useful posts to the PHP General list-- and they were both for the same thread. If you have that much free time on your

[PHP] Rewind foreach loop

2007-11-29 Thread Jeffery Fernandez
Hi all, Is it possible to rewind a foreach loop? eg: $numbers = array(0,1,2,3,4,5,6,7,8,9,10); foreach ($numbers as $index = $value) { if ($value == 5) { prev($numbers); } echo Value: $value . PHP_EOL; } The above doesn't seem to work. In one of

Re: [PHP] Join question

2007-11-29 Thread Robert Cummings
On Fri, 2007-11-30 at 10:21 +0800, Crayon Shin Chan wrote: On Friday 30 November 2007, tedd wrote: I'm trying to understand joins, Ask on a database related list. That's an amusing statement. I took a peek back in time and noticed that in the past 5 months you've only made two on-topic

Re: [PHP] Join question [solved]

2007-11-29 Thread Robert Cummings
On Thu, 2007-11-29 at 18:43 -0500, tedd wrote: Hi gang: I found why the JOIN didn't work for me in this instance, which was I needed to create a third table and JOIN what I needed in that table from the other two. My problem was that I was trying to alter one of the tables in the

Re: [PHP] Join question [solved]

2007-11-29 Thread Chris
Out of curiosity, what SQL server (and version) are you using? I currently have MySQL 5.0.33 on my dev box and I had no problem with the query I gave you. Perhaps it's a version issue. There really shouldn't be a problem updating a table that also occurs in the select query since the select

Re: [PHP] Rewind foreach loop

2007-11-29 Thread Jeffery Fernandez
I think the best option for me is to refactorise my code a bit to cater to my situation. Thanks all for your help. Jeffery On Fri, 30 Nov 2007 02:32:11 pm Jeffery Fernandez wrote: On Fri, 30 Nov 2007 02:13:52 pm Chris wrote: Jeffery Fernandez wrote: On Fri, 30 Nov 2007 02:01:47 pm Chris

Re: [PHP] Join question

2007-11-29 Thread Robert Cummings
On Fri, 2007-11-30 at 11:00 +0800, Crayon Shin Chan wrote: On Friday 30 November 2007, Robert Cummings wrote: That's an amusing statement. I took a peek back in time and noticed that in the past 5 months you've only made two on-topic useful posts to the PHP General list-- and they were

Re: [PHP] Rewind foreach loop

2007-11-29 Thread Casey
$keys = array_values($array); for ($i=0; $icount($keys); $i++) { if ($keys[$i] == 5) $i -= 2; } Untested, but should work. On Nov 29, 2007, at 7:13 PM, Chris [EMAIL PROTECTED] wrote: Jeffery Fernandez wrote: On Fri, 30 Nov 2007 02:01:47 pm Chris wrote: Jeffery Fernandez wrote:

Re: [PHP] Join question [solved]

2007-11-29 Thread Robert Cummings
On Fri, 2007-11-30 at 14:00 +1100, Chris wrote: Out of curiosity, what SQL server (and version) are you using? I currently have MySQL 5.0.33 on my dev box and I had no problem with the query I gave you. Perhaps it's a version issue. There really shouldn't be a problem updating a table that

Re: [PHP] Rewind foreach loop

2007-11-29 Thread Steve Edberg
At 2:11 PM +1100 11/30/07, Jeffery Fernandez wrote: On Fri, 30 Nov 2007 02:01:47 pm Chris [EMAIL PROTECTED] wrote: Jeffery Fernandez wrote: Hi all, Is it possible to rewind a foreach loop? eg: $numbers = array(0,1,2,3,4,5,6,7,8,9,10); foreach ($numbers as $index = $value) {

Re: [PHP] Rewind foreach loop

2007-11-29 Thread Chris
Jeffery Fernandez wrote: Hi all, Is it possible to rewind a foreach loop? eg: $numbers = array(0,1,2,3,4,5,6,7,8,9,10); foreach ($numbers as $index = $value) { if ($value == 5) { prev($numbers); } echo Value: $value . PHP_EOL; } The above

Re: [PHP] Rewind foreach loop

2007-11-29 Thread Jeffery Fernandez
On Fri, 30 Nov 2007 02:01:47 pm Chris wrote: Jeffery Fernandez wrote: Hi all, Is it possible to rewind a foreach loop? eg: $numbers = array(0,1,2,3,4,5,6,7,8,9,10); foreach ($numbers as $index = $value) { if ($value == 5) { prev($numbers);

Re: [PHP] Join question

2007-11-29 Thread Crayon Shin Chan
On Friday 30 November 2007, tedd wrote: I'm trying to understand joins, Ask on a database related list. -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Rewind foreach loop

2007-11-29 Thread Chris
Jeffery Fernandez wrote: On Fri, 30 Nov 2007 02:01:47 pm Chris wrote: Jeffery Fernandez wrote: Hi all, Is it possible to rewind a foreach loop? eg: $numbers = array(0,1,2,3,4,5,6,7,8,9,10); foreach ($numbers as $index = $value) { if ($value == 5) {

Re: [PHP] Rewind foreach loop

2007-11-29 Thread Jeffery Fernandez
On Fri, 30 Nov 2007 02:13:52 pm Chris wrote: Jeffery Fernandez wrote: On Fri, 30 Nov 2007 02:01:47 pm Chris wrote: Jeffery Fernandez wrote: Hi all, Is it possible to rewind a foreach loop? eg: $numbers = array(0,1,2,3,4,5,6,7,8,9,10); foreach ($numbers as $index = $value) {

Re: [PHP] Join question

2007-11-29 Thread Crayon Shin Chan
On Friday 30 November 2007, Robert Cummings wrote: Or are you saying that one needs to make a lot of on-topic posts to build up credit in order to be able to make off-topic posts? No, I'm merely pointing out the hypocrisy. That would only be true if I had been making off-topic posts. But so

Re: [PHP] Join question

2007-11-29 Thread Robert Cummings
On Fri, 2007-11-30 at 13:49 +0800, Crayon Shin Chan wrote: On Friday 30 November 2007, Robert Cummings wrote: Or are you saying that one needs to make a lot of on-topic posts to build up credit in order to be able to make off-topic posts? No, I'm merely pointing out the hypocrisy.

Re: [PHP] Dynamic Display of Images Stored in DB

2007-11-29 Thread Børge Holen
On Friday 30 November 2007 00:39:39 Chris wrote: Hell, I'm all ok with this method... but does (different) webhotells take into account the amount used with cache/temp files. If so, some check should be used, and if not. Cache it all!, and remove the timelimit, some check for the change of