Help: Two dimensional array from table
am 07.04.2006 17:27:28 von Mark Fellowes
------=_EDNP_0000_930d6052-9fbe-4fe7-a887-519f3be0f778
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
ï»=BFI created an array to pull data out of one column in database.=
{=0A $usrregid[] =3D $row_rs_usr_usr["usr_id"];=0A} while($row_rs_usr_u=
sr =3D mysql_fetch_assoc($rs_usr_usr));=0A//end of registered=0A?>
=
However I now need a second column from the table and think a two dimens=
ional array is the right way to go. Having a problem though in defining.=
Most of the examples I found don't seem to apply to pulling the values=
from a db.
I tried this and while it returns no errors, it also=
returns no value.
ay("id", "date");=0Ado {=0A $usrreg[] =3D $row_rs_usr_usr["usr_id"]["usr=
_date];=0A} while($row_rs_usr_usr =3D mysql_fetch_assoc($rs_usr_usr));=
=0A//end of registered=0A?>
Am I defining wrong or pulling the valu=
es wrong ?
TIA=0AMark
__________________________________________
Organize. Communicate. Share. @ http://www.goowy.com
------=_EDNP_0000_930d6052-9fbe-4fe7-a887-519f3be0f778--
Re: Help: Two dimensional array from table
am 09.04.2006 15:55:42 von El Bekko
Mark Fellowes wrote:
> I created an array to pull data out of one column in database.
>
>
> //Code for registered
> $usrregid = array();
> do {
> $usrregid[] = $row_rs_usr_usr["usr_id"];
> } while($row_rs_usr_usr = mysql_fetch_assoc($rs_usr_usr));
> //end of registered
> ?>
>
> However I now need a second column from the table and think a two dimensional array is the right way to go. Having a problem though in defining. Most of the examples I found don't seem to apply to pulling the values from a db.
>
> I tried this and while it returns no errors, it also returns no value.
>
>
> //Code for registered
> $usrreg = array("id", "date");
> do {
> $usrreg[] = $row_rs_usr_usr["usr_id"]["usr_date];
> } while($row_rs_usr_usr = mysql_fetch_assoc($rs_usr_usr));
> //end of registered
> ?>
>
> Am I defining wrong or pulling the values wrong ?
>
> TIA
> Mark
> __________________________________________
> Organize. Communicate. Share. @ http://www.goowy.com
Maybe try it this way:
//Code for registered
$usrreg = array("id", "date");
do {
$usrreg[]["id"] = $row_rs_usr_usr["usr_id"]
$userrag["date"] = $row_rs_usr_usr["usr_date];
} while($row_rs_usr_usr = mysql_fetch_assoc($rs_usr_usr));
//end of registered
?>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php