Re: arrays

From: Date: Sun, 04 Feb 2001 22:59:50 +0000
Subject: Re: arrays
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-6371@lists.php.net to get a copy of this message
see www.php.net/odbc you want to use odbc_field_name() and odbc_num_fields() Siggy ----- Original Message ----- From: "Alarion" <alarion@planetunreal.com> To: "'phobo'" <antiphobo@paradise.net.nz> Cc: <php-db@lists.php.net> Sent: Monday, February 05, 2001 11:46 AM Subject: RE: [PHP-DB] arrays > Right, but what I am trying to figure out, is how to get the "key" names for > the arrays. > > for example, if I have a users table: > users > ------------- > id > name > password > > and I want to select * from users and load ALL the data into an array, for > the use in easily moving back and forth in the data set, how would I load > it? > > something like: > $Colcount = odbc_fetch_into($Result, $RowNum, $datarow); > $dataset[$RowNum] = $datarow file://dataset would be my master array that houses > all rows/data > > ? > > Sean > > -----Original Message----- > From: phobo [mailto:antiphobo@paradise.net.nz] > Sent: Sunday, February 04, 2001 5:20 PM > To: Alarion > Cc: php-db@lists.php.net > Subject: Re: [PHP-DB] arrays > > > Like this: > > $blah = "hello"; > $miaow[$blah][5] = 3.14; > > ( is the same as doing $miaow["hello"][5] = 3.14; ) > > - Siggy > > ----- Original Message ----- > From: "Alarion" <alarion@planetunreal.com> > To: "'PHP-DB'" <php-db@lists.php.net> > Sent: Monday, February 05, 2001 10:06 AM > Subject: [PHP-DB] arrays > > > > Hello, > > Well, I haven't used arrays in PHP too much and am wondering how I might > > go about this: > > > > I want to loop through a result set, say with ODBC, and use the > > "fetch_array" function for each row. Now, What I want is a an array of all > > the rows, so I could then access the "Name" column in Row 5 like > > $values[NAME][5]. > > How would I create an array that way? > > > > Any help would be appreciated, thanks > > > > Sean Finkel > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > For additional commands, e-mail: php-db-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.db (#6371) next »