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 create

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

2001-02-12 Thread Zak Greant
Well, I guess that hacking the php source would work. :) However, I was just thinking that you Could do something like this: (Note - not tested! :) while (list ($key, $value) = mysql_fetch_array ($result, MYSQL_ASSOC)) { $data[] = $data[$key] = $value; } --zak - Original Message

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 abstraction

[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

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

2001-02-09 Thread Zak Greant
This list is for discussing issues that relate to the development of the PHP language. For mailing lists that discuss development with PHP, see www.php.net/support.php Also, even though [0] and ['id'] initially contain the same value, they are not bound together in any way. You may be able to