RE: [PHP-DEV] how-to get array[0] and array["name"] to actually reference only 1 value?

2001-02-12 Thread Marc Boeren
>Well, I guess that hacking the php source would work. :) However, I was >just thinking that you Could do something like this: >while (list ($key, $value) = mysql_fetch_array ($result, MYSQL_ASSOC)) { >$data[] =& $data[$key] = $value; >} I could, but since I'm writing a database abstractio

Re: [PHP-DEV] how-to get array[0] and array["name"] to actually reference only 1 value?

2001-02-12 Thread Zak Greant
sage - From: "Marc Boeren" <[EMAIL PROTECTED]> To: "'Zak Greant'" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, February 12, 2001 2:25 AM Subject: RE: [PHP-DEV] how-to get array[0] and array["name"] to actually reference only 1 va

RE: [PHP-DEV] how-to get array[0] and array["name"] to actually reference only 1 value?

2001-02-12 Thread Marc Boeren
OK, zend_hash_find and zend_hash_index_find do the trick... Cheerio, Marc. >This leads me to another question: how do I obtain the x_ptr (from the example) if the zend_hash_update was done elsewhere and no ptr was passed then??? >zend_hash_update(return_value->value.obj.properties, "x", s

RE: [PHP-DEV] how-to get array[0] and array["name"] to actually reference only 1 value?

2001-02-12 Thread Marc Boeren
>not bound together in any way. You may be able to accomplish what you >desire by using references. (See the manual section on references for more >information. > ie. $q->data[0]["id"] =& $q->data[0][0]; After looking for references in the php-code, I found something that seems to work ok (ze

RE: [PHP-DEV] how-to get array[0] and array["name"] to actually reference only 1 value?

2001-02-12 Thread Marc Boeren
>Also, even though [0] and ['id'] initially contain the same value, they are >not bound together in any way. You may be able to accomplish what you >desire by using references. (See the manual section on references for more >information. >ie. $q->data[0]["id"] =& $q->data[0][0]; How can I cre

Re: [PHP-DEV] how-to get array[0] and array["name"] to actually reference only 1 value?

2001-02-09 Thread Zak Greant
> Sent: Friday, February 09, 2001 2:37 AM Subject: [PHP-DEV] how-to get array[0] and array["name"] to actually reference only 1 value? > > What I'm trying to do is get the following php-script to work... (the only > thing about this that doesn't work is in

[PHP-DEV] how-to get array[0] and array["name"] to actually reference only 1 value?

2001-02-09 Thread Marc Boeren
What I'm trying to do is get the following php-script to work... (the only thing about this that doesn't work is in the fourth 'echo' line...) $db = dbx_connect("mysql", "localhost", "username", "password"); // works $result = dbx_query($db, "use dbname"); // works $q = dbx_query($db, "select id