Now we can access the values from mysql result set based on the index and/or with the name.
For eg: SELECT name,id FROM tbl_user
name = resultset[0] OR name = resultset[‘name’]
I need to retrieve the values from mysql result set with only index or with name.
i am using PHP.
You can get result row as an associative array, a numeric array, or both.
mysql_fetch_array can be used. Use make of the second optional parameter to get the result in desired array type.
result type can be
MYSQL_ASSOC,MYSQL_NUMorMYSQL_BOTH(default)you can also use the mysql_fetch_assoc, if you need result only an associative array.