hi all,
here's a problem i've recently run into. I've got a DB table with fields "ID", "Title", and "Description" (for instance). I've also got a query of "SELECT * FROM <table>". I run the query using mysql_query(), and store the result in, oh, let's say $result.
OK. Now, I use mysql_fetch_array() to put the first row of $result into an array aptly titled $row. Herein lies my problem:
looking into $row, i find it's structured like this:
0 => value1
ID =>value1
1=> value2
Title => value2
2 => value3
Description => value3
I see what it's doing (creating both numbered and named references to the data) but i don't want it to do this. I really just want the named references.
Anyone know of a way to get rid of these numbered array keys?
here's a problem i've recently run into. I've got a DB table with fields "ID", "Title", and "Description" (for instance). I've also got a query of "SELECT * FROM <table>". I run the query using mysql_query(), and store the result in, oh, let's say $result.
OK. Now, I use mysql_fetch_array() to put the first row of $result into an array aptly titled $row. Herein lies my problem:
looking into $row, i find it's structured like this:
0 => value1
ID =>value1
1=> value2
Title => value2
2 => value3
Description => value3
I see what it's doing (creating both numbered and named references to the data) but i don't want it to do this. I really just want the named references.
Anyone know of a way to get rid of these numbered array keys?