Re: [PHP-DEV] inserting into mysql

2003-01-22 Thread Derick Rethans
Hello,

please forward user questions to the [EMAIL PROTECTED]
mailinglist, this list is for development _OF_ PHP, not development
_with_ PHP.

Derick

On Wed, 22 Jan 2003, Diana Castillo wrote:

> When I insert a date into Mysql it has to be in year/month/day format or
> else it wont go in right.
> how do I convert my date variable which is in month /day /year format into
> year/month/day format?
> 
> 
> --
> Productos de salud:
> http://www.nvtechnologies.com/hgh
> 
> 
> 
> -- 
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Distributing Extensions

2003-01-22 Thread George Schlossnagle

On Thursday, January 23, 2003, at 12:17  AM, Brian Moon wrote:

 Is PECL ready for this stuff?


Yes.


--
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Distributing Extensions

2003-01-22 Thread Brian Moon
I have made and tested (originally againts 4.2.1 now against 4.3.0) a C
extension to PHP that allows you to name variables in the ini file that are
to be treated as super globals.  This is very handy for dealnews as we have
several variables (database object, directory paths, etc.) that are
constantly getting "globaled" in functions.  Yes, we could use constants,
but that won't work for the database class and they are harder to work with
in strings.

To the point, I want to know how/where this should be distributed.  I want
to do it "right".  I can write up some docs that tell you where to stick the
code, run buildconf, etc., but I wondered if there was a preferred way of
handling C extensions.  Is PECL ready for this stuff?

Thanks,

Brian Moon
dealnews.com



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] foreach nastiness with references (bug #21702)

2003-01-22 Thread Vaclav Dvorak
Moriyoshi Koizumi wrote:

Moriyoshi Koizumi wrote:

1) Each time before entering a foreach loop, php first tries to make a 
copy of
 the array being iterated.

2) In case the array variable is either referenceing another variable or
 referenced by another variable, no copy is made here and the original
 array is used instead. Because of this behaviour, the original's 
 internal
 array pointer increases in the loop eventually.

Yes, I understand this. What I don't understand is WHY is it so? Why is 
foreach handling references specially? Why is your point 2) there?

Oh, I found this issue was pointed out pretty long time ago.

- Bug #5052
  http://bugs.php.net/5052

- Bug #5270 (deleted?)
  http://news.php.net/article.php?group=php.dev&article=22668
http://news.php.net/article.php?group=php.dev&article=22672
  http://news.php.net/article.php?group=php.dev&article=22673

[...]

Anyway, please search the database first, in order not to post the
same kind of bug twice.


I did search the database, and indeed I did see that bug (#5052) before 
posting my bug report. In fact, if you read my bug report, you will see 
that I even mention this bug, and yet another one (#14607). The bug you 
now found (#5052) is similar but NOT the same. In fact, it describes the 
opposite behaviour: the reporter there says that nested foreach's on two 
COPIES of the same array don't work, and that he can work around the bug 
by making a reference to the array. In my bug, nested foreach on a copy 
works, but not on a reference.

So there, I'm not such a complete idiot, you know. ;-)

Regards,

Vaclav Dvorak


--
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] foreach nastiness with references (bug #21702)

2003-01-22 Thread Moriyoshi Koizumi
On Wed, Jan 22, 2003 at 04:12:18PM +0100, Vaclav Dvorak wrote:
> Moriyoshi Koizumi wrote:
> >I tried to answer this question in the bug report page.
> [...]
> >1) Each time before entering a foreach loop, php first tries to make a 
> >copy of
> >   the array being iterated.
> >
> >2) In case the array variable is either referenceing another variable or
> >   referenced by another variable, no copy is made here and the original
> >   array is used instead. Because of this behaviour, the original's 
> >   internal
> >   array pointer increases in the loop eventually.
> 
> Yes, I understand this. What I don't understand is WHY is it so? Why is 
> foreach handling references specially? Why is your point 2) there?
> 

Oh, I found this issue was pointed out pretty long time ago.

- Bug #5052
  http://bugs.php.net/5052

- Bug #5270 (deleted?)
  http://news.php.net/article.php?group=php.dev&article=22668
http://news.php.net/article.php?group=php.dev&article=22672
  http://news.php.net/article.php?group=php.dev&article=22673

It seems that the commit I mentioned in the previous mail was just
for those problem reports. As no much discussion took place there,
all I can guess from them is there was already a fear of breaking BC. 

Anyway, please search the database first, in order not to post the
same kind of bug twice.

Moriyoshi


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] inserting into mysql

2003-01-22 Thread Diana Castillo
When I insert a date into Mysql it has to be in year/month/day format or
else it wont go in right.
how do I convert my date variable which is in month /day /year format into
year/month/day format?


--
Productos de salud:
http://www.nvtechnologies.com/hgh



-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] INI_STR usage in browscap (and others) causes crash

2003-01-22 Thread Shane Caraveo
Hello,

We have several places in our code (specificly in browscap.c) where we 
have bugs due to either improper usage of INI_STR, or improper results 
from zend_ini.c:zend_ini_string.

The code:

if (INI_STR("browscap")) {
   zend_hash_destroy(&browser_hash);
}

Will fail if there is no 'browscap' entry in php.ini since 
zend_ini_string returns "".  Adding 'browscap = ;' to php.ini fixes 
that, but causes an error on startup because the init cannot open ''.

The fix would be:

char *browscap = INI_STR("browscap");
if (browscap && *browscap) {
   zend_hash_destroy(&browser_hash);
}

A quick search in the code shows we have this problem in several places 
(php_imap.c, browscap.c, mail.c, sendmail.c, possibly more depending on 
usage of variables).

For some reason, this but only sporadicaly appears for me, but most 
often does when loading (any) debugger extension on linux.  In the case 
of the browscap, I actually get a segfault in the mshutdown.

So, is it improper usage of INI_STR, or is it incorrect results from 
zend_ini_string?  I'd like to get these fixed for 4.3.1.

Shane





--
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] foreach nastiness with references (bug #21702)

2003-01-22 Thread Vaclav Dvorak
Moriyoshi Koizumi wrote:

I tried to answer this question in the bug report page.

[...]

1) Each time before entering a foreach loop, php first tries to make a copy of
   the array being iterated.

2) In case the array variable is either referenceing another variable or
   referenced by another variable, no copy is made here and the original
   array is used instead. Because of this behaviour, the original's internal
   array pointer increases in the loop eventually.


Yes, I understand this. What I don't understand is WHY is it so? Why is 
foreach handling references specially? Why is your point 2) there?

I probably don't see all the consequences (I know little about PHP/Zend 
internals and have found no documentation), but wouldn't the fix be as 
simple as changing the SEPARATE_ZVAL_IF_NOT_REF into SEPARATE_ZVAL on 
line 2251 of Zend/zend_execute.c? URL: 
http://lxr.php.net/source/php4/Zend/zend_execute.c#2251 (search for 
"case ZEND_FE_RESET:" if line numbers shift).

BTW, what's the relation of http://lxr.php.net/source/php4/Zend/ and 
http://lxr.php.net/source/Zend/ ?

Vaclav Dvorak  <[EMAIL PROTECTED]>


--
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DEV] Re: #17088 [Com]: GET/POST variables not registered

2003-01-22 Thread Derick Rethans
On 22 Jan 2003 [EMAIL PROTECTED] wrote:

> Right now CVS HEAD isn't building with a
> '/ext/standard/basic_functions.c:2827: `ZEND_INI_PARSER_POP_ENTRY'
> undeclared (first use in this function)' but I'm working on that. 
> (Last time this happened I had to re-checkout the source tree, which
> indicates that 'make clean' is missing something..)

You need a "cvs co php5" (instead of php4) from now on, which checks out
ZendEngine 2 instead of Zend Engine 1, which doesn't work with HEAD
anymore.

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 JDI Media Solutions http://www.jdimedia.nl/
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


-- 
PHP Development Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php