OSEC

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 12 Oct 2005 02:28:47 -0000 Issue 3732

php-general-digest-helplists.php.net
Date: Tue Oct 11 2005 - 21:28:47 CDT


php-general Digest 12 Oct 2005 02:28:47 -0000 Issue 3732

Topics (messages 223894 through 223939):

Re: Run a php script as a separate thread/process
        223894 by: Petar Nedyalkov
        223901 by: Silvio Porcellana

Re: Help with logic :(
        223895 by: aaronjw.martekbiz.com
        223898 by: Dan McCullough
        223902 by: Jochem Maas
        223905 by: aaronjw.martekbiz.com
        223906 by: Dan McCullough
        223907 by: aaronjw.martekbiz.com
        223909 by: Kilbride, James
        223910 by: Silvio Porcellana
        223911 by: aaronjw.martekbiz.com
        223912 by: John Nichel
        223913 by: Dan McCullough

looking for code to delete from lists..
        223896 by: bruce
        223897 by: Kilbride, James

mssql_*() functions and stored procedures
        223899 by: Chris Boget
        223927 by: Jochem Maas

Re: Get Mac Address
        223900 by: Jim Moseby
        223939 by: Rory Browne

Speed/Efficiency Question: Large array into DB
        223903 by: Alan Lord
        223921 by: Brent Baisley
        223925 by: Alan Lord

Obsession with BC
        223904 by: GamblerZG
        223908 by: Robert Cummings
        223914 by: Richard Davey
        223915 by: GamblerZG
        223916 by: Dan McCullough
        223917 by: Kilbride, James
        223918 by: GamblerZG
        223919 by: Dan McCullough
        223920 by: Kilbride, James
        223922 by: Robert Cummings
        223924 by: Richard Davey
        223928 by: Jochem Maas
        223929 by: GamblerZG
        223930 by: Kilbride, James
        223931 by: GamblerZG
        223934 by: Stephen Leaf
        223936 by: GamblerZG

Picture loaded but not shown
        223923 by: Bagus Nugroho

PDO & pgsql?
        223926 by: Jeffrey Sambells

onChange js running a php function
        223932 by: Dan McCullough
        223933 by: tg-php.gryffyndevelopment.com
        223935 by: Brent Baisley

object as function argument
        223937 by: Björn Bartels
        223938 by: Jasper Bryant-Greene

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


On Tuesday 11 October 2005 14:12, Tommy Jensehaugen wrote:
> Hi,
> Anyone knows how to start a php script as a separate thread/process from
> another php script?

Yes, you can check: http://bg.php.net/manual/en/ref.exec.php for details.

>
> example.php:
>
> <?php
> some logic
>
>
> execute('separate_script.php');
> more logic
>
>
> ?>
>
> The reason why I want to do this is because separate_script.php has to be
> fully executed even if the request for example.php is stopped in the middle
> of "more logic".
> I am using PHP Version 4.3.11.
>
> Thank you very much for your help..
>
> Cheers,
> Tommy

--

Cyberly yours,
Petar Nedyalkov
Devoted Orbitel Fan :-)

PGP ID: 7AE45436
PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc
PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)

iD8DBQBDS8NALT98C3rkVDYRAsLmAJ4reQ1IuD+XZaNJ0xzyqDofw2zZCgCbBFYp
unBOUkXEe8OnMYDjILfL5aY=
=bppf
-----END PGP SIGNATURE-----

attached mail follows:


Tommy Jensehaugen wrote:
>
> <snip />
>
> The reason why I want to do this is because separate_script.php has to be
> fully executed even if the request for example.php is stopped in the middle
> of "more logic".
> I am using PHP Version 4.3.11.
>

You might also want to give a look at this:
http://php.net/manual/en/function.ignore-user-abort.php

HTH, cheers.
Silvio

attached mail follows:


Hi Richard,

Ok... I do already have a Unique index on the column but this process is
something that I cannot echo out the error code to the user. The code is
generated on the fly when an order an is placed so you can see... I can't
echo out the error to the customer.

Can I do an if statement IF an error is returned to try generatre another
randon code and keep going until one is available? I can do this all
intenrally without the customer knowing/seeing anything?

Hope I am making some sense. Not trying to confuse the issue.

Thanks. Appreciate your thoughts.

Aaron

> On Mon, October 10, 2005 3:24 pm, Dan McCullough wrote:
>> create a function to check if the rndnumber=couponcode row count = 0
>> if not then redo rndnumber if it does = 0 then insert rndnumber
>
> Noooooooooooooooooooooooooooo!
>
> You are creating a RACE CONDITION in which ONE user might generate a
> 'valid' code, and ANOTHER user might generate a 'valid' code AT THE
> SAME TIME, and then they BOTH get the same coupon code.
>
> The probability of this is very very very low, but still NOT zero.
>
> And it's the kind of thing that won't show up in testing, but sure as
> God made little green apples, it WILL happen at the worst possible
> time after you "go live"
>
> The database engine has a *TON* of code in it to avoid this kind of
> Bad Thing happening.
>
> Use it.
>
> create a UNIQUE INDEX on the column that needs to be unique.
>
> Trap the INSERT error.
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Yes I believe that is what Richard was saying about "Trap the INSERT
error", you should get an error back from the database about having a
problem with the insert instead of showing that error you will want to
add some logic that when that error occurs you simply generate another
number.

On 10/11/05, aaronjwmartekbiz.com <aaronjwmartekbiz.com> wrote:
> Hi Richard,
>
> Ok... I do already have a Unique index on the column but this process is
> something that I cannot echo out the error code to the user. The code is
> generated on the fly when an order an is placed so you can see... I can't
> echo out the error to the customer.
>
> Can I do an if statement IF an error is returned to try generatre another
> randon code and keep going until one is available? I can do this all
> intenrally without the customer knowing/seeing anything?
>
> Hope I am making some sense. Not trying to confuse the issue.
>
> Thanks. Appreciate your thoughts.
>
> Aaron
>
> > On Mon, October 10, 2005 3:24 pm, Dan McCullough wrote:
> >> create a function to check if the rndnumber=couponcode row count = 0
> >> if not then redo rndnumber if it does = 0 then insert rndnumber
> >
> > Noooooooooooooooooooooooooooo!
> >
> > You are creating a RACE CONDITION in which ONE user might generate a
> > 'valid' code, and ANOTHER user might generate a 'valid' code AT THE
> > SAME TIME, and then they BOTH get the same coupon code.
> >
> > The probability of this is very very very low, but still NOT zero.
> >
> > And it's the kind of thing that won't show up in testing, but sure as
> > God made little green apples, it WILL happen at the worst possible
> > time after you "go live"
> >
> > The database engine has a *TON* of code in it to avoid this kind of
> > Bad Thing happening.
> >
> > Use it.
> >
> > create a UNIQUE INDEX on the column that needs to be unique.
> >
> > Trap the INSERT error.
> >
> > --
> > Like Music?
> > http://l-i-e.com/artists.htm
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>

attached mail follows:


Dan McCullough wrote:
> Yes I believe that is what Richard was saying about "Trap the INSERT
> error", you should get an error back from the database about having a
> problem with the insert instead of showing that error you will want to
> add some logic that when that error occurs you simply generate another
> number.

I concur! the OP has the idea :-)

>
> On 10/11/05, aaronjwmartekbiz.com <aaronjwmartekbiz.com> wrote:
>
>>Hi Richard,
>>
>>Ok... I do already have a Unique index on the column but this process is
>>something that I cannot echo out the error code to the user. The code is
>>generated on the fly when an order an is placed so you can see... I can't
>>echo out the error to the customer.
>>
>>Can I do an if statement IF an error is returned to try generatre another
>>randon code and keep going until one is available? I can do this all
>>intenrally without the customer knowing/seeing anything?
>>
>>Hope I am making some sense. Not trying to confuse the issue.
>>
>>Thanks. Appreciate your thoughts.
>>
>>Aaron
>>
>>
>>>On Mon, October 10, 2005 3:24 pm, Dan McCullough wrote:
>>>
>>>>create a function to check if the rndnumber=couponcode row count = 0
>>>>if not then redo rndnumber if it does = 0 then insert rndnumber
>>>
>>>Noooooooooooooooooooooooooooo!
>>>
>>>You are creating a RACE CONDITION in which ONE user might generate a
>>>'valid' code, and ANOTHER user might generate a 'valid' code AT THE
>>>SAME TIME, and then they BOTH get the same coupon code.
>>>
>>>The probability of this is very very very low, but still NOT zero.
>>>
>>>And it's the kind of thing that won't show up in testing, but sure as
>>>God made little green apples, it WILL happen at the worst possible
>>>time after you "go live"
>>>
>>>The database engine has a *TON* of code in it to avoid this kind of
>>>Bad Thing happening.
>>>
>>>Use it.
>>>
>>>create a UNIQUE INDEX on the column that needs to be unique.
>>>
>>>Trap the INSERT error.
>>>
>>>--
>>>Like Music?
>>>http://l-i-e.com/artists.htm
>>>
>>>--
>>>PHP General Mailing List (http://www.php.net/)
>>>To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>>
>

attached mail follows:


Thanks everyone. Makes sense. Now I got another issue.

When I try to see if an error exists I get this:

Warning: mysql_error(): supplied argument is not a valid MySQL-Link
resource in /home/********/public_html/Store/test.php on line 14

Is there a setting somewhere that I need to set to make sure this is
available?

Thanks and sorry is these are dumb-ass questions :)

Aaron

> Yes I believe that is what Richard was saying about "Trap the INSERT
> error", you should get an error back from the database about having a
> problem with the insert instead of showing that error you will want to
> add some logic that when that error occurs you simply generate another
> number.
>
> On 10/11/05, aaronjwmartekbiz.com <aaronjwmartekbiz.com> wrote:
>> Hi Richard,
>>
>> Ok... I do already have a Unique index on the column but this process is
>> something that I cannot echo out the error code to the user. The code is
>> generated on the fly when an order an is placed so you can see... I
>> can't
>> echo out the error to the customer.
>>
>> Can I do an if statement IF an error is returned to try generatre
>> another
>> randon code and keep going until one is available? I can do this all
>> intenrally without the customer knowing/seeing anything?
>>
>> Hope I am making some sense. Not trying to confuse the issue.
>>
>> Thanks. Appreciate your thoughts.
>>
>> Aaron
>>
>> > On Mon, October 10, 2005 3:24 pm, Dan McCullough wrote:
>> >> create a function to check if the rndnumber=couponcode row count = 0
>> >> if not then redo rndnumber if it does = 0 then insert rndnumber
>> >
>> > Noooooooooooooooooooooooooooo!
>> >
>> > You are creating a RACE CONDITION in which ONE user might generate a
>> > 'valid' code, and ANOTHER user might generate a 'valid' code AT THE
>> > SAME TIME, and then they BOTH get the same coupon code.
>> >
>> > The probability of this is very very very low, but still NOT zero.
>> >
>> > And it's the kind of thing that won't show up in testing, but sure as
>> > God made little green apples, it WILL happen at the worst possible
>> > time after you "go live"
>> >
>> > The database engine has a *TON* of code in it to avoid this kind of
>> > Bad Thing happening.
>> >
>> > Use it.
>> >
>> > create a UNIQUE INDEX on the column that needs to be unique.
>> >
>> > Trap the INSERT error.
>> >
>> > --
>> > Like Music?
>> > http://l-i-e.com/artists.htm
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


got some code so we can see?

On 10/11/05, aaronjwmartekbiz.com <aaronjwmartekbiz.com> wrote:
> Thanks everyone. Makes sense. Now I got another issue.
>
> When I try to see if an error exists I get this:
>
> Warning: mysql_error(): supplied argument is not a valid MySQL-Link
> resource in /home/********/public_html/Store/test.php on line 14
>
> Is there a setting somewhere that I need to set to make sure this is
> available?
>
> Thanks and sorry is these are dumb-ass questions :)
>
> Aaron
>
>
> > Yes I believe that is what Richard was saying about "Trap the INSERT
> > error", you should get an error back from the database about having a
> > problem with the insert instead of showing that error you will want to
> > add some logic that when that error occurs you simply generate another
> > number.
> >
> > On 10/11/05, aaronjwmartekbiz.com <aaronjwmartekbiz.com> wrote:
> >> Hi Richard,
> >>
> >> Ok... I do already have a Unique index on the column but this process is
> >> something that I cannot echo out the error code to the user. The code is
> >> generated on the fly when an order an is placed so you can see... I
> >> can't
> >> echo out the error to the customer.
> >>
> >> Can I do an if statement IF an error is returned to try generatre
> >> another
> >> randon code and keep going until one is available? I can do this all
> >> intenrally without the customer knowing/seeing anything?
> >>
> >> Hope I am making some sense. Not trying to confuse the issue.
> >>
> >> Thanks. Appreciate your thoughts.
> >>
> >> Aaron
> >>
> >> > On Mon, October 10, 2005 3:24 pm, Dan McCullough wrote:
> >> >> create a function to check if the rndnumber=couponcode row count = 0
> >> >> if not then redo rndnumber if it does = 0 then insert rndnumber
> >> >
> >> > Noooooooooooooooooooooooooooo!
> >> >
> >> > You are creating a RACE CONDITION in which ONE user might generate a
> >> > 'valid' code, and ANOTHER user might generate a 'valid' code AT THE
> >> > SAME TIME, and then they BOTH get the same coupon code.
> >> >
> >> > The probability of this is very very very low, but still NOT zero.
> >> >
> >> > And it's the kind of thing that won't show up in testing, but sure as
> >> > God made little green apples, it WILL happen at the worst possible
> >> > time after you "go live"
> >> >
> >> > The database engine has a *TON* of code in it to avoid this kind of
> >> > Bad Thing happening.
> >> >
> >> > Use it.
> >> >
> >> > create a UNIQUE INDEX on the column that needs to be unique.
> >> >
> >> > Trap the INSERT error.
> >> >
> >> > --
> >> > Like Music?
> >> > http://l-i-e.com/artists.htm
> >> >
> >> > --
> >> > PHP General Mailing List (http://www.php.net/)
> >> > To unsubscribe, visit: http://www.php.net/unsub.php
> >> >
> >> >
> >>
> >>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>

attached mail follows:


<?php

        include ("../utils.inc");

        $date = date("U");
        $dateExpire = $date + 90 * 86400;

        $code = "jack";

        $query = "INSERT INTO CouponTable VALUES
('','$date','0','$code','preset','$dateExpire','3.75')";

        $result = mysql_query($query);

        echo mysql_error($result);

?>

This SHOULD error out but I'm getting the error instead.

It's just a test page to test my logic...

A
> got some code so we can see?
>
> On 10/11/05, aaronjwmartekbiz.com <aaronjwmartekbiz.com> wrote:
>> Thanks everyone. Makes sense. Now I got another issue.
>>
>> When I try to see if an error exists I get this:
>>
>> Warning: mysql_error(): supplied argument is not a valid MySQL-Link
>> resource in /home/********/public_html/Store/test.php on line 14
>>
>> Is there a setting somewhere that I need to set to make sure this is
>> available?
>>
>> Thanks and sorry is these are dumb-ass questions :)
>>
>> Aaron
>>
>>
>> > Yes I believe that is what Richard was saying about "Trap the INSERT
>> > error", you should get an error back from the database about having a
>> > problem with the insert instead of showing that error you will want to
>> > add some logic that when that error occurs you simply generate another
>> > number.
>> >
>> > On 10/11/05, aaronjwmartekbiz.com <aaronjwmartekbiz.com> wrote:
>> >> Hi Richard,
>> >>
>> >> Ok... I do already have a Unique index on the column but this process
>> is
>> >> something that I cannot echo out the error code to the user. The code
>> is
>> >> generated on the fly when an order an is placed so you can see... I
>> >> can't
>> >> echo out the error to the customer.
>> >>
>> >> Can I do an if statement IF an error is returned to try generatre
>> >> another
>> >> randon code and keep going until one is available? I can do this all
>> >> intenrally without the customer knowing/seeing anything?
>> >>
>> >> Hope I am making some sense. Not trying to confuse the issue.
>> >>
>> >> Thanks. Appreciate your thoughts.
>> >>
>> >> Aaron
>> >>
>> >> > On Mon, October 10, 2005 3:24 pm, Dan McCullough wrote:
>> >> >> create a function to check if the rndnumber=couponcode row count =
>> 0
>> >> >> if not then redo rndnumber if it does = 0 then insert rndnumber
>> >> >
>> >> > Noooooooooooooooooooooooooooo!
>> >> >
>> >> > You are creating a RACE CONDITION in which ONE user might generate
>> a
>> >> > 'valid' code, and ANOTHER user might generate a 'valid' code AT THE
>> >> > SAME TIME, and then they BOTH get the same coupon code.
>> >> >
>> >> > The probability of this is very very very low, but still NOT zero.
>> >> >
>> >> > And it's the kind of thing that won't show up in testing, but sure
>> as
>> >> > God made little green apples, it WILL happen at the worst possible
>> >> > time after you "go live"
>> >> >
>> >> > The database engine has a *TON* of code in it to avoid this kind of
>> >> > Bad Thing happening.
>> >> >
>> >> > Use it.
>> >> >
>> >> > create a UNIQUE INDEX on the column that needs to be unique.
>> >> >
>> >> > Trap the INSERT error.
>> >> >
>> >> > --
>> >> > Like Music?
>> >> > http://l-i-e.com/artists.htm
>> >> >
>> >> > --
>> >> > PHP General Mailing List (http://www.php.net/)
>> >> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >> >
>> >> >
>> >>
>> >>
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Did you remember to open the database connection?

> -----Original Message-----
> From: aaronjwmartekbiz.com [mailto:aaronjwmartekbiz.com]
> Sent: Tuesday, October 11, 2005 1:34 PM
> To: Dan McCullough
> Cc: php-generallists.php.net
> Subject: Re: [PHP] Help with logic :(
>
> <?php
>
> include ("../utils.inc");
>
> $date = date("U");
> $dateExpire = $date + 90 * 86400;
>
> $code = "jack";
>
> $query = "INSERT INTO CouponTable VALUES
> ('','$date','0','$code','preset','$dateExpire','3.75')";
>
> $result = mysql_query($query);
>
> echo mysql_error($result);
>
> ?>
>
> This SHOULD error out but I'm getting the error instead.
>
> It's just a test page to test my logic...
>
> A
> > got some code so we can see?
> >
> > On 10/11/05, aaronjwmartekbiz.com <aaronjwmartekbiz.com> wrote:
> >> Thanks everyone. Makes sense. Now I got another issue.
> >>
> >> When I try to see if an error exists I get this:
> >>
> >> Warning: mysql_error(): supplied argument is not a valid
> MySQL-Link
> >> resource in /home/********/public_html/Store/test.php on line 14
> >>
> >> Is there a setting somewhere that I need to set to make
> sure this is
> >> available?
> >>
> >> Thanks and sorry is these are dumb-ass questions :)
> >>
> >> Aaron
> >>
> >>
> >> > Yes I believe that is what Richard was saying about "Trap the
> >> > INSERT error", you should get an error back from the
> database about
> >> > having a problem with the insert instead of showing that
> error you
> >> > will want to add some logic that when that error occurs
> you simply
> >> > generate another number.
> >> >
> >> > On 10/11/05, aaronjwmartekbiz.com <aaronjwmartekbiz.com> wrote:
> >> >> Hi Richard,
> >> >>
> >> >> Ok... I do already have a Unique index on the column but this
> >> >> process
> >> is
> >> >> something that I cannot echo out the error code to the
> user. The
> >> >> code
> >> is
> >> >> generated on the fly when an order an is placed so you
> can see...
> >> >> I can't echo out the error to the customer.
> >> >>
> >> >> Can I do an if statement IF an error is returned to try
> generatre
> >> >> another randon code and keep going until one is
> available? I can
> >> >> do this all intenrally without the customer knowing/seeing
> >> >> anything?
> >> >>
> >> >> Hope I am making some sense. Not trying to confuse the issue.
> >> >>
> >> >> Thanks. Appreciate your thoughts.
> >> >>
> >> >> Aaron
> >> >>
> >> >> > On Mon, October 10, 2005 3:24 pm, Dan McCullough wrote:
> >> >> >> create a function to check if the rndnumber=couponcode row
> >> >> >> count =
> >> 0
> >> >> >> if not then redo rndnumber if it does = 0 then
> insert rndnumber
> >> >> >
> >> >> > Noooooooooooooooooooooooooooo!
> >> >> >
> >> >> > You are creating a RACE CONDITION in which ONE user might
> >> >> > generate
> >> a
> >> >> > 'valid' code, and ANOTHER user might generate a
> 'valid' code AT
> >> >> > THE SAME TIME, and then they BOTH get the same coupon code.
> >> >> >
> >> >> > The probability of this is very very very low, but
> still NOT zero.
> >> >> >
> >> >> > And it's the kind of thing that won't show up in testing, but
> >> >> > sure
> >> as
> >> >> > God made little green apples, it WILL happen at the worst
> >> >> > possible time after you "go live"
> >> >> >
> >> >> > The database engine has a *TON* of code in it to
> avoid this kind
> >> >> > of Bad Thing happening.
> >> >> >
> >> >> > Use it.
> >> >> >
> >> >> > create a UNIQUE INDEX on the column that needs to be unique.
> >> >> >
> >> >> > Trap the INSERT error.
> >> >> >
> >> >> > --
> >> >> > Like Music?
> >> >> > http://l-i-e.com/artists.htm
> >> >> >
> >> >> > --
> >> >> > PHP General Mailing List (http://www.php.net/) To
> unsubscribe,
> >> >> > visit: http://www.php.net/unsub.php
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> > --
> >> > PHP General Mailing List (http://www.php.net/) To unsubscribe,
> >> > visit: http://www.php.net/unsub.php
> >> >
> >> >
> >>
> >>
> >
> > --
> > PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit:
> > http://www.php.net/unsub.php
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


aaronjwmartekbiz.com wrote:
> <?php
>
> include ("../utils.inc");
>
> $date = date("U");
> $dateExpire = $date + 90 * 86400;
>
> $code = "jack";
>
> $query = "INSERT INTO CouponTable VALUES
> ('','$date','0','$code','preset','$dateExpire','3.75')";
>
> $result = mysql_query($query);
>
> echo mysql_error($result);
>
> ?>
>
> This SHOULD error out but I'm getting the error instead.
>
> It's just a test page to test my logic...
>

If you read carefully this page:

http://php.net/mysql_error

you will notice that it says that you need to pass to mysql_error *the
MySQL connection*. Not the resource returned by mysql_query.

HTH, cheers
Silvio

attached mail follows:


It's open because if I remove the mysql_error(); and change the value for
$code.... it will insert.

A

> Did you remember to open the database connection?
>
>> -----Original Message-----
>> From: aaronjwmartekbiz.com [mailto:aaronjwmartekbiz.com]
>> Sent: Tuesday, October 11, 2005 1:34 PM
>> To: Dan McCullough
>> Cc: php-generallists.php.net
>> Subject: Re: [PHP] Help with logic :(
>>
>> <?php
>>
>> include ("../utils.inc");
>>
>> $date = date("U");
>> $dateExpire = $date + 90 * 86400;
>>
>> $code = "jack";
>>
>> $query = "INSERT INTO CouponTable VALUES
>> ('','$date','0','$code','preset','$dateExpire','3.75')";
>>
>> $result = mysql_query($query);
>>
>> echo mysql_error($result);
>>
>> ?>
>>
>> This SHOULD error out but I'm getting the error instead.
>>
>> It's just a test page to test my logic...
>>
>> A
>> > got some code so we can see?
>> >
>> > On 10/11/05, aaronjwmartekbiz.com <aaronjwmartekbiz.com> wrote:
>> >> Thanks everyone. Makes sense. Now I got another issue.
>> >>
>> >> When I try to see if an error exists I get this:
>> >>
>> >> Warning: mysql_error(): supplied argument is not a valid
>> MySQL-Link
>> >> resource in /home/********/public_html/Store/test.php on line 14
>> >>
>> >> Is there a setting somewhere that I need to set to make
>> sure this is
>> >> available?
>> >>
>> >> Thanks and sorry is these are dumb-ass questions :)
>> >>
>> >> Aaron
>> >>
>> >>
>> >> > Yes I believe that is what Richard was saying about "Trap the
>> >> > INSERT error", you should get an error back from the
>> database about
>> >> > having a problem with the insert instead of showing that
>> error you
>> >> > will want to add some logic that when that error occurs
>> you simply
>> >> > generate another number.
>> >> >
>> >> > On 10/11/05, aaronjwmartekbiz.com <aaronjwmartekbiz.com> wrote:
>> >> >> Hi Richard,
>> >> >>
>> >> >> Ok... I do already have a Unique index on the column but this
>> >> >> process
>> >> is
>> >> >> something that I cannot echo out the error code to the
>> user. The
>> >> >> code
>> >> is
>> >> >> generated on the fly when an order an is placed so you
>> can see...
>> >> >> I can't echo out the error to the customer.
>> >> >>
>> >> >> Can I do an if statement IF an error is returned to try
>> generatre
>> >> >> another randon code and keep going until one is
>> available? I can
>> >> >> do this all intenrally without the customer knowing/seeing
>> >> >> anything?
>> >> >>
>> >> >> Hope I am making some sense. Not trying to confuse the issue.
>> >> >>
>> >> >> Thanks. Appreciate your thoughts.
>> >> >>
>> >> >> Aaron
>> >> >>
>> >> >> > On Mon, October 10, 2005 3:24 pm, Dan McCullough wrote:
>> >> >> >> create a function to check if the rndnumber=couponcode row
>> >> >> >> count > >> 0
>> >> >> >> if not then redo rndnumber if it does = 0 then
>> insert rndnumber
>> >> >> >
>> >> >> > Noooooooooooooooooooooooooooo!
>> >> >> >
>> >> >> > You are creating a RACE CONDITION in which ONE user might
>> >> >> > generate
>> >> a
>> >> >> > 'valid' code, and ANOTHER user might generate a
>> 'valid' code AT
>> >> >> > THE SAME TIME, and then they BOTH get the same coupon code.
>> >> >> >
>> >> >> > The probability of this is very very very low, but
>> still NOT zero.
>> >> >> >
>> >> >> > And it's the kind of thing that won't show up in testing, but
>> >> >> > sure
>> >> as
>> >> >> > God made little green apples, it WILL happen at the worst
>> >> >> > possible time after you "go live"
>> >> >> >
>> >> >> > The database engine has a *TON* of code in it to
>> avoid this kind
>> >> >> > of Bad Thing happening.
>> >> >> >
>> >> >> > Use it.
>> >> >> >
>> >> >> > create a UNIQUE INDEX on the column that needs to be unique.
>> >> >> >
>> >> >> > Trap the INSERT error.
>> >> >> >
>> >> >> > --
>> >> >> > Like Music?
>> >> >> > http://l-i-e.com/artists.htm
>> >> >> >
>> >> >> > --
>> >> >> > PHP General Mailing List (http://www.php.net/) To
>> unsubscribe,
>> >> >> > visit: http://www.php.net/unsub.php
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >> >
>> >> > --
>> >> > PHP General Mailing List (http://www.php.net/) To unsubscribe,
>> >> > visit: http://www.php.net/unsub.php
>> >> >
>> >> >
>> >>
>> >>
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/) To
>> unsubscribe, visit:
>> > http://www.php.net/unsub.php
>> >
>> >
>>
>> --
>> PHP General Mailing List (http://www.php.net/) To
>> unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


aaronjwmartekbiz.com wrote:
> <?php
>
> include ("../utils.inc");
>
> $date = date("U");
> $dateExpire = $date + 90 * 86400;
>
> $code = "jack";
>
> $query = "INSERT INTO CouponTable VALUES
> ('','$date','0','$code','preset','$dateExpire','3.75')";
>
> $result = mysql_query($query);
>
> echo mysql_error($result);
>
> ?>
>
> This SHOULD error out but I'm getting the error instead.
>
> It's just a test page to test my logic...
>
> A

Check to see if there is an error first....

if ( ! $result = mysql_query ( $query ) ) {
        echo ( mysql_error() );
}

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


$result = mysql_query($query) or die(mysql_error());

On 10/11/05, Silvio Porcellana <sporctin.it> wrote:
> aaronjwmartekbiz.com wrote:
> > <?php
> >
> > include ("../utils.inc");
> >
> > $date = date("U");
> > $dateExpire = $date + 90 * 86400;
> >
> > $code = "jack";
> >
> > $query = "INSERT INTO CouponTable VALUES
> > ('','$date','0','$code','preset','$dateExpire','3.75')";
> >
> > $result = mysql_query($query);
> >
> > echo mysql_error($result);
> >
> > ?>
> >
> > This SHOULD error out but I'm getting the error instead.
> >
> > It's just a test page to test my logic...
> >
>
> If you read carefully this page:
>
> http://php.net/mysql_error
>
> you will notice that it says that you need to pass to mysql_error *the
> MySQL connection*. Not the resource returned by mysql_query.
>
> HTH, cheers
> Silvio
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


hi.

i'm generating a list

  +----------------+
  | |
  | foo |
  | cat |
  | . |
  | . |
  | . |
  | |
  +----------------+

    cancel/submit

i want to give the user the ability to delete single/multiple rows from the
list. i then want to be able to write/submit the resulting list. any code
samples, or pointers to apps that all ready do this would be appreciated.
i'd prefer to not reinvent the wheel!

i'm thinking that i could create a select/option list, and then allow the
user to select any items that they want to delete. the app would then
iterate through the array on the submit, and do an update on the db tbls..

thanks

-bruce
bedouglasearthlink.net

attached mail follows:


Multiple Select form element, submit button. On submit iterate through
the submitted sequence to delete from the database(or use a delete from
statement that has the list of items depending on other work you want to
do on the list before deletion). HTML_QuickForm gives you an easy way to
generate the list.

James Kilbride

> -----Original Message-----
> From: bruce [mailto:bedouglasearthlink.net]
> Sent: Tuesday, October 11, 2005 10:06 AM
> To: php-generallists.php.net
> Subject: [PHP] looking for code to delete from lists..
>
> hi.
>
> i'm generating a list
>
> +----------------+
> | |
> | foo |
> | cat |
> | . |
> | . |
> | . |
> | |
> +----------------+
>
> cancel/submit
>
> i want to give the user the ability to delete single/multiple
> rows from the list. i then want to be able to write/submit
> the resulting list. any code samples, or pointers to apps
> that all ready do this would be appreciated.
> i'd prefer to not reinvent the wheel!
>
> i'm thinking that i could create a select/option list, and
> then allow the user to select any items that they want to
> delete. the app would then iterate through the array on the
> submit, and do an update on the db tbls..
>
> thanks
>
> -bruce
> bedouglasearthlink.net
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Looking through the documentation, I see that I can use

mssql_init()
mssql_bind()
mssql_execute()

to execute those stored procedures that have parameters.
But what about those SPs which just return a value? If I
have the following SP

CREATE PROCEDURE MySP
AS
  DECLARE resultCode int
  SELECT resultCode = 539
  RETURN resultCode
GO

And execute the above as follows

DECLARE result int;
EXEC result = MySP;
PRINT result;

within Query Analyzer, how do I emulate this using the mssql_*()
functions? Whenever I try to just run the EXEC, I keep getting an
error message saying that I have to declare the result variable.
I've tried to declare the variable in a seperate mssql_query() call
but that doesn't seem to have an effect. So how can I do this w/o
getting an error w/r/t variable declaration?

thnx,
Christoph

attached mail follows:


Chris Boget wrote:
> Looking through the documentation, I see that I can use
>
> mssql_init()
> mssql_bind()
> mssql_execute()
>
> to execute those stored procedures that have parameters.
> But what about those SPs which just return a value? If I
> have the following SP
>
> CREATE PROCEDURE MySP
> AS
> DECLARE resultCode int
> SELECT resultCode = 539
> RETURN resultCode
> GO
>
> And execute the above as follows
>
> DECLARE result int;
> EXEC result = MySP;
> PRINT result;

in firebird I would do something like:

SELECT result FROM MySP

maybe that works for you in mssql?

>
> within Query Analyzer, how do I emulate this using the mssql_*()
> functions? Whenever I try to just run the EXEC, I keep getting an
> error message saying that I have to declare the result variable.
> I've tried to declare the variable in a seperate mssql_query() call
> but that doesn't seem to have an effect. So how can I do this w/o

is it possible to start a transaction first then run the 2 queries?

> getting an error w/r/t variable declaration?
>
> thnx,
> Christoph
>

attached mail follows:


> -----Original Message-----
> From: Ben Sagal [mailto:bmsagalgmail.com]
> Sent: Tuesday, October 11, 2005 7:05 AM
> To: M. Sokolewicz
> Cc: Rory Browne; php-generallists.php.net
> Subject: Re: [PHP] Get Mac Address
>
>
> I did mention this is an INTRANET server so all clients are be local,
> there are no router between the clients and the server.
>
> how would i go about accessing arp from php, (the server runs Linux)?
>

Hi Ben,

Try:

/* notice the backtics, and that arp on linux usually needs to run as root
*/
$arpoutput = `/sbin/arp -a`;

JM

attached mail follows:


> Hi Ben,
>
> Try:
>
> /* notice the backtics, and that arp on linux usually needs to run as root
Which means that you either have to install sudo, or set the suid bit.

> */
> $arpoutput = `/sbin/arp -a`;

Do a "man arp" on linux to see what form of the arp command you want.
It's a while since I used it.

>
> JM
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Hi All,

Not being a professional programmer I am looking for some advice about
the best way to do the following:

I have a large multidimensional array (up to 7Mb) It contains a list of
categories in a fairly normal Cat_ID and Parent_ID arrangement. The
array also contains a great deal of superfluous information which I want
to ignore.

I wish to walk through the entire array, select 4 key/value pairs from
each sub-array and write those to my Database (Keys are: Cat_ID,
Parent_ID, CatName, CatLevel). I wish to ignore all other key/values in
each array.

I'm guessing that I should use array_walk_recursive() and apply my test
for valid keys then write this into my db... But, should I do this for
each iteration, or make a new array with just the information I need
then write that into my DB? And do I use a transaction/commit block and
try to do the whole thing in one db-write or again, INSERT on each step
through my array?

Oh yes, the key names in the array correspond to field names in my
database.

Sorry it's a bit long-winded...

Thanks in advance for any suggestions.

Alan

attached mail follows:


Sounds to me like you are trying to import data. In which case it
would be best to create a text file and import it rather than putting
PHP in the middle.

But if you are going us to PHP, I would not do individual INSERTs.
The overhead will really slow things down with number of inserts you
are doing. Use the multiple value insert syntax and do multiple bulk
inserts or just one big one. Although doing one big one will end up
being an all or nothing deal. With multiple bulk inserts, you'd be
able to write to a log file between inserts so you can track it's
progress.

I would step through the array, creating the string for inserting
(value1, value2, value3, value4),(value1, value2, value3, value4),
(value1, value2, value3, value4),...

On Oct 11, 2005, at 12:28 PM, Alan Lord wrote:

> Hi All,
>
> Not being a professional programmer I am looking for some advice about
> the best way to do the following:
>
> I have a large multidimensional array (up to 7Mb) It contains a
> list of
> categories in a fairly normal Cat_ID and Parent_ID arrangement. The
> array also contains a great deal of superfluous information which I
> want
> to ignore.
>
> I wish to walk through the entire array, select 4 key/value pairs from
> each sub-array and write those to my Database (Keys are: Cat_ID,
> Parent_ID, CatName, CatLevel). I wish to ignore all other key/
> values in
> each array.
>
> I'm guessing that I should use array_walk_recursive() and apply my
> test
> for valid keys then write this into my db... But, should I do this for
> each iteration, or make a new array with just the information I need
> then write that into my DB? And do I use a transaction/commit block
> and
> try to do the whole thing in one db-write or again, INSERT on each
> step
> through my array?
>
> Oh yes, the key names in the array correspond to field names in my
> database.
>
> Sorry it's a bit long-winded...
>
> Thanks in advance for any suggestions.
>
> Alan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

attached mail follows:


Thanks for the reply.

I am indeed importing data, but from far away over the 'net, and it
changes frequently so needs updating regularly.

I like the idea of creating a file (I'll do it ram rather than a text
file I think) with the insert strings...

Thanks

Alan

> -----Original Message-----
> From: Brent Baisley [mailto:brentlandover.com]
> Sent: 11 October 2005 19:35
> To: Alan Lord
> Cc: php-generallists.php.net
> Subject: Re: [PHP] Speed/Efficiency Question: Large array into DB
>
> Sounds to me like you are trying to import data. In which
> case it would be best to create a text file and import it
> rather than putting PHP in the middle.
>
> But if you are going us to PHP, I would not do individual INSERTs.
> The overhead will really slow things down with number of
> inserts you are doing. Use the multiple value insert syntax
> and do multiple bulk inserts or just one big one. Although
> doing one big one will end up being an all or nothing deal.
> With multiple bulk inserts, you'd be able to write to a log
> file between inserts so you can track it's progress.
>
> I would step through the array, creating the string for
> inserting (value1, value2, value3, value4),(value1, value2,
> value3, value4), (value1, value2, value3, value4),...
>
>
> On Oct 11, 2005, at 12:28 PM, Alan Lord wrote:
>
> > Hi All,
> >
> > Not being a professional programmer I am looking for some
> advice about
> > the best way to do the following:
> >
> > I have a large multidimensional array (up to 7Mb) It
> contains a list
> > of categories in a fairly normal Cat_ID and Parent_ID
> arrangement. The
> > array also contains a great deal of superfluous information which I
> > want to ignore.
> >
> > I wish to walk through the entire array, select 4 key/value
> pairs from
> > each sub-array and write those to my Database (Keys are: Cat_ID,
> > Parent_ID, CatName, CatLevel). I wish to ignore all other
> key/ values
> > in each array.
> >
> > I'm guessing that I should use array_walk_recursive() and apply my
> > test for valid keys then write this into my db... But, should I do
> > this for each iteration, or make a new array with just the
> information
> > I need then write that into my DB? And do I use a
> transaction/commit
> > block and try to do the whole thing in one db-write or
> again, INSERT
> > on each step through my array?
> >
> > Oh yes, the key names in the array correspond to field names in my
> > database.
> >
> > Sorry it's a bit long-winded...
> >
> > Thanks in advance for any suggestions.
> >
> > Alan
> >
> > --
> > PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit:
> > http://www.php.net/unsub.php
> >
> >
> >
>
> --
> Brent Baisley
> Systems Architect
> Landover Associates, Inc.
> Search & Advisory Services for Advanced Technology Environments
> p: 212.759.6400/800.759.0577
>
>
>

attached mail follows:


Recently, I asked my hosting provider when they are going to switch to
PHP5. They replied that it will not happen any time soon, since they
will install PHP5 only on new servers. Their reasoning was simple: PHP5
will inevitably break some old scripts, and it's just not worh all the
trouble. Such attitude is common, and it totally makes sence from a
business perspective. That begs the question, why PHP developers are so
worried about maintaining BC? There is a simple alternative:

<?php //parse this with mod_php4
function class_method($var){ }
?>
<?php5 //parse this with mod_php5
class clazz implements Something{
     function method($var) {
     }
}
?>

So what's the reasoning behind BC maintenanse?

attached mail follows:


On Tue, 2005-10-11 at 12:41, GamblerZG wrote:
> Recently, I asked my hosting provider when they are going to switch to
> PHP5. They replied that it will not happen any time soon, since they
> will install PHP5 only on new servers. Their reasoning was simple: PHP5
> will inevitably break some old scripts, and it's just not worh all the
> trouble. Such attitude is common, and it totally makes sence from a
> business perspective. That begs the question, why PHP developers are so
> worried about maintaining BC? There is a simple alternative:
>
> <?php //parse this with mod_php4
> function class_method($var){ }
> ?>
> <?php5 //parse this with mod_php5
> class clazz implements Something{
> function method($var) {
> }
> }
> ?>
>
> So what's the reasoning behind BC maintenanse?

Ummm, maybe your speaking alien, but could you clarify how that solves
the problem you are addressing?

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:


Hi,

Tuesday, October 11, 2005, 5:41:53 PM, you wrote:

> Recently, I asked my hosting provider when they are going to switch
> to PHP5. They replied that it will not happen any time soon, since
> they will install PHP5 only on new servers. Their reasoning was
> simple: PHP5 will inevitably break some old scripts, and it's just
> not worh all the trouble. Such attitude is common, and it totally
> makes sence from a business perspective.

It does? I wouldn't waste my money with a host that was unable to
provide PHP 5 support, at least in some way. I think the "it will
break lots of scripts" is a cop-out. There are various ways to allow
both on one server. Assuming they're technically proficient enough of
course.

Cheers,

Rich
--
Zend Certified Engineer
http://www.launchcode.co.uk

attached mail follows:


>><?php //parse this with mod_php4
>>function class_method($var){ }
>>?>
>><?php5 //parse this with mod_php5
>>class clazz implements Something{
>> function method($var) {
>> }
>>}
>>?>
>
> Ummm, maybe your speaking alien, but could you clarify how that solves
> the problem you are addressing?

First, if every version of the language would have it's own tag, then
there would be no need to maintain BC beyond reasonable necessity.

Second, hosing providers would be more apt to uprade. They would simply
add new module without removing the old one. This way both old and new
scripts would work perfectly fine without the need for some kind of
compatibility mode.

attached mail follows:


None of my code breaks from 4 to 5, I also run a small hosting company
and I upgrade when I see improvements to the software that would
warrent an upgrade. MySQL 4.1.12, Apache 2, PHP5. I also think its a
cop out by those who dont have alot of time to upgrade their 30+
servers. Another stall or cop-out would be were currently testing
php5 and will have an evaluation in a few weeks *cough* months.

On 10/11/05, Richard Davey <richcorephp.co.uk> wrote:
> Hi,
>
> Tuesday, October 11, 2005, 5:41:53 PM, you wrote:
>
> > Recently, I asked my hosting provider when they are going to switch
> > to PHP5. They replied that it will not happen any time soon, since
> > they will install PHP5 only on new servers. Their reasoning was
> > simple: PHP5 will inevitably break some old scripts, and it's just
> > not worh all the trouble. Such attitude is common, and it totally
> > makes sence from a business perspective.
>
> It does? I wouldn't waste my money with a host that was unable to
> provide PHP 5 support, at least in some way. I think the "it will
> break lots of scripts" is a cop-out. There are various ways to allow
> both on one server. Assuming they're technically proficient enough of
> course.
>
> Cheers,
>
> Rich
> --
> Zend Certified Engineer
> http://www.launchcode.co.uk
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


4 to 5 does break a lot of code. On the other hand I agree it's a cop
out. On the final hand, if you pass the pages off from apache to a php
exe or module.. How does Apache know which one to pass it to? Php4 or
Php5? If I have both php4 and php5 code in a page should i run both
sections or only the sections listed for php5(if it's on php5)? If I
only run one then I am maintaining two code branches in the same files.
Seems like a bad idea to me. I don't really see how that idea would work
well. And I do think it seems like a cop out that they can't provide
php5 somehow.

James Kilbride

> -----Original Message-----
> From: Dan McCullough [mailto:dan.mcculloughgmail.com]
> Sent: Tuesday, October 11, 2005 2:04 PM
> To: php-generallists.php.net
> Subject: Re: [PHP] Obsession with BC
>
> None of my code breaks from 4 to 5, I also run a small
> hosting company and I upgrade when I see improvements to the
> software that would warrent an upgrade. MySQL 4.1.12, Apache
> 2, PHP5. I also think its a cop out by those who dont have
> alot of time to upgrade their 30+ servers. Another stall or
> cop-out would be were currently testing
> php5 and will have an evaluation in a few weeks *cough* months.
>
> On 10/11/05, Richard Davey <richcorephp.co.uk> wrote:
> > Hi,
> >
> > Tuesday, October 11, 2005, 5:41:53 PM, you wrote:
> >
> > > Recently, I asked my hosting provider when they are going
> to switch
> > > to PHP5. They replied that it will not happen any time
> soon, since
> > > they will install PHP5 only on new servers. Their reasoning was
> > > simple: PHP5 will inevitably break some old scripts, and
> it's just
> > > not worh all the trouble. Such attitude is common, and it totally
> > > makes sence from a business perspective.
> >
> > It does? I wouldn't waste my money with a host that was unable to
> > provide PHP 5 support, at least in some way. I think the "it will
> > break lots of scripts" is a cop-out. There are various ways
> to allow
> > both on one server. Assuming they're technically proficient
> enough of
> > course.
> >
> > Cheers,
> >
> > Rich
> > --
> > Zend Certified Engineer
> > http://www.launchcode.co.uk
> >
> > --
> > PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit:
> > http://www.php.net/unsub.php
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


> It does? I wouldn't waste my money with a host that was unable to
> provide PHP 5 support, at least in some way. I think the "it will
> break lots of scripts" is a cop-out. There are various ways to allow
> both on one server. Assuming they're technically proficient enough of
> course.

'What is the best way to get to get to Detroit from here?'
'You don't need to go to Detroit. It's cold in there. San-Francisco is
much better.'

Do you see the problem here? You're not adressing the issue I spoke about.

Issue: I think BC slows down the evolution of the language. I know for
sure it makes some people less willing to upgrade. And there are ways of
avoding unnecessary BC maintenance altogether.

attached mail follows:


The real problem is that it generates customer service and support
calls to the hosting company, which they dont like to have to deal
with, because in the end it will be a coding issue and most of the
people out there wont realize it and get mad and leave.

On 10/11/05, Kilbride, James <James.Kilbridegd-ais.com> wrote:
> 4 to 5 does break a lot of code. On the other hand I agree it's a cop
> out. On the final hand, if you pass the pages off from apache to a php
> exe or module.. How does Apache know which one to pass it to? Php4 or
> Php5? If I have both php4 and php5 code in a page should i run both
> sections or only the sections listed for php5(if it's on php5)? If I
> only run one then I am maintaining two code branches in the same files.
> Seems like a bad idea to me. I don't really see how that idea would work
> well. And I do think it seems like a cop out that they can't provide
> php5 somehow.
>
> James Kilbride
>
> > -----Original Message-----
> > From: Dan McCullough [mailto:dan.mcculloughgmail.com]
> > Sent: Tuesday, October 11, 2005 2:04 PM
> > To: php-generallists.php.net
> > Subject: Re: [PHP] Obsession with BC
> >
> > None of my code breaks from 4 to 5, I also run a small
> > hosting company and I upgrade when I see improvements to the
> > software that would warrent an upgrade. MySQL 4.1.12, Apache
> > 2, PHP5. I also think its a cop out by those who dont have
> > alot of time to upgrade their 30+ servers. Another stall or
> > cop-out would be were currently testing
> > php5 and will have an evaluation in a few weeks *cough* months.
> >
> > On 10/11/05, Richard Davey <richcorephp.co.uk> wrote:
> > > Hi,
> > >
> > > Tuesday, October 11, 2005, 5:41:53 PM, you wrote:
> > >
> > > > Recently, I asked my hosting provider when they are going
> > to switch
> > > > to PHP5. They replied that it will not happen any time
> > soon, since
> > > > they will install PHP5 only on new servers. Their reasoning was
> > > > simple: PHP5 will inevitably break some old scripts, and
> > it's just
> > > > not worh all the trouble. Such attitude is common, and it totally
> > > > makes sence from a business perspective.
> > >
> > > It does? I wouldn't waste my money with a host that was unable to
> > > provide PHP 5 support, at least in some way. I think the "it will
> > > break lots of scripts" is a cop-out. There are various ways
> > to allow
> > > both on one server. Assuming they're technically proficient
> > enough of
> > > course.
> > >
> > > Cheers,
> > >
> > > Rich
> > > --
> > > Zend Certified Engineer
> > > http://www.launchcode.co.uk
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/) To
> > unsubscribe, visit:
> > > http://www.php.net/unsub.php
> > >
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/) To
> > unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

attached mail follows:


I don't mean replace php4 with 5, but it seems odd they can't provide 5
to those users that want it. Keeping php4 for those places that were in
place originally. Especially since not providing any php5 will also
cause people to get mad and leave.

James Kilbride

> -----Original Message-----
> From: Dan McCullough [mailto:dan.mcculloughgmail.com]
> Sent: Tuesday, October 11, 2005 2:19 PM
> To: php-generallists.php.net
> Subject: Re: [PHP] Obsession with BC
>
> The real problem is that it generates customer service and
> support calls to the hosting company, which they dont like to
> have to deal with, because in the end it will be a coding
> issue and most of the people out there wont realize it and
> get mad and leave.
>
> On 10/11/05, Kilbride, James <James.Kilbridegd-ais.com> wrote:
> > 4 to 5 does break a lot of code. On the other hand I agree
> it's a cop
> > out. On the final hand, if you pass the pages off from
> apache to a php
> > exe or module.. How does Apache know which one to pass it
> to? Php4 or
> > Php5? If I have both php4 and php5 code in a page should i run both
> > sections or only the sections listed for php5(if it's on
> php5)? If I
> > only run one then I am maintaining two code branches in the
> same files.
> > Seems like a bad idea to me. I don't really see how that idea would
> > work well. And I do think it seems like a cop out that they can't
> > provide
> > php5 somehow.
> >
> > James Kilbride
> >
> > > -----Original Message-----
> > > From: Dan McCullough [mailto:dan.mcculloughgmail.com]
> > > Sent: Tuesday, October 11, 2005 2:04 PM
> > > To: php-generallists.php.net
> > > Subject: Re: [PHP] Obsession with BC
> > >
> > > None of my code breaks from 4 to 5, I also run a small hosting
> > > company and I upgrade when I see improvements to the
> software that
> > > would warrent an upgrade. MySQL 4.1.12, Apache 2, PHP5. I also
> > > think its a cop out by those who dont have alot of time
> to upgrade
> > > their 30+ servers. Another stall or cop-out would be
> were currently
> > > testing
> > > php5 and will have an evaluation in a few weeks *cough* months.
> > >
> > > On 10/11/05, Richard Davey <richcorephp.co.uk> wrote:
> > > > Hi,
> > > >
> > > > Tuesday, October 11, 2005, 5:41:53 PM, you wrote:
> > > >
> > > > > Recently, I asked my hosting provider when they are going
> > > to switch
> > > > > to PHP5. They replied that it will not happen any time
> > > soon, since
> > > > > they will install PHP5 only on new servers. Their
> reasoning was
> > > > > simple: PHP5 will inevitably break some old scripts, and
> > > it's just
> > > > > not worh all the trouble. Such attitude is common, and it
> > > > > totally makes sence from a business perspective.
> > > >
> > > > It does? I wouldn't waste my money with a host that was
> unable to
> > > > provide PHP 5 support, at least in some way. I think
> the "it will
> > > > break lots of scripts" is a cop-out. There are various ways
> > > to allow
> > > > both on one server. Assuming they're technically proficient
> > > enough of
> > > > course.
> > > >
> > > > Cheers,
> > > >
> > > > Rich
> > > > --
> > > > Zend Certified Engineer
> > > > http://www.launchcode.co.uk
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/) To
> > > unsubscribe, visit:
> > > > http://www.php.net/unsub.php
> > > >
> > > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/) To unsubscribe,
> > > visit: http://www.php.net/unsub.php
> > >
> > >
> >
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


On Tue, 2005-10-11 at 13:57, GamblerZG wrote:
> >><?php //parse this with mod_php4
> >>function class_method($var){ }
> >>?>
> >><?php5 //parse this with mod_php5
> >>class clazz implements Something{
> >> function method($var) {
> >> }
> >>}
> >>?>
> >
> > Ummm, maybe your speaking alien, but could you clarify how that solves
> > the problem you are addressing?
>
> First, if every version of the language would have it's own tag, then
> there would be no need to maintain BC beyond reasonable necessity.
>
> Second, hosing providers would be more apt to uprade. They would simply
> add new module without removing the old one. This way both old and new
> scripts would work perfectly fine without the need for some kind of
> compatibility mode.

Sounds like whole different nightmare. I for one don't want to have to
go through all of my code and change <php to <php5. True, it's a 10
second script, but then my code doesn't work with <php, ACK now I need
two versions of MY code to ensure it works for PHP4. No thanks.

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:


Hi,

Tuesday, October 11, 2005, 7:14:05 PM, you wrote:

> Issue: I think BC slows down the evolution of the language. I know
> for sure it makes some people less willing to upgrade. And there are
> ways of avoding unnecessary BC maintenance altogether.

Beyond not staying stuck in the past? Not really. You either code for
PHP4