Jump to content

$row array


johnnyk

Recommended Posts

Yes as the mysql_fetch_array returns an array with both associative and number indices

if you want to use numbers for the array keys use this:
mysql_fetch_array(mysql_query("SELECT a, b FROM `table`"), MYSQL_NUM)

But if you want letters for the array keys use this:
mysql_fetch_array(mysql_query("SELECT a, b FROM `table`"), MYSQL_ASSOC)
Link to comment
https://forums.phpfreaks.com/topic/12409-row-array/#findComment-47444
Share on other sites

[!--quoteo(post=385777:date=Jun 19 2006, 03:43 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 19 2006, 03:43 PM) [snapback]385777[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Yes as the mysql_fetch_array returns an array with both associative and number indices

if you want to use numbers for the array keys use this:
mysql_fetch_array(mysql_query("SELECT a, b FROM `table`"), MYSQL_NUM)

But if you want letters for the array keys use this:
mysql_fetch_array(mysql_query("SELECT a, b FROM `table`"), MYSQL_ASSOC)
[/quote]

Why does it return it as both? Would specifying MYSQL_NUM or MYSQL_ASSOC make it return the results faster?
Link to comment
https://forums.phpfreaks.com/topic/12409-row-array/#findComment-47451
Share on other sites

Because if you dont specify the secound parameter as the the type you want the result to be return as mysql_fetch_array will retun both number indicies and associative arrays. I wont make it return the result faster, well it will but you wont be able to notice as its very small.
Link to comment
https://forums.phpfreaks.com/topic/12409-row-array/#findComment-47455
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.