Difference between MYSQL_ASSOC,MYSQL_NUM and MYSQL_BOTH ?
Answers were Sorted based on User's Feedback
Answer / avanthi g
Fetch a result row as an associative array, a numeric array, or both
Returns an array that corresponds to the fetched row and moves the internal data pointer ahead.
Example:
MYSQL_NUM returns a numerically indexed array.
$row = mysql_fetch_array($result, MYSQL_NUM);
echo $row[0];
MYSQL_ASSOC returns an associative array.
$row = mysql_fetch_array($result, MYSQL_ASSOC);
echo $row["student_id"];
MYSQL_BOTH returns both.
$row = mysql_fetch_array($result, MYSQL_BOTH)
echo $row[0]." ".$row["name"];
Is This Answer Correct ? | 46 Yes | 4 No |
Answer / deepak sakure
difference between MYSQL_NUM AND MYSQL_ASSOC.
MYSQL_NUM returns a numerically indexed array.
MYSQL_ASSOC returns an associative array.
Is This Answer Correct ? | 20 Yes | 3 No |
Answer / test
difference between MYSQL_NUM AND MYSQL_ASSOC.
MYSQL_NUM returns a numerically indexed array.
MYSQL_ASSOC returns an associative array.
Is This Answer Correct ? | 1 Yes | 0 No |
What is the use of i-am-a-dummy flag in mysql?
What is the current mysql version?
What are the ways in which you can retrieve data in the result set of mysql using php?
What is the difference between b-tree and hash indexes?
What mysql -u john -p command does?
What is unique key in mysql?
How to represent ENUMs and SETs internally?
How to upload a large file through phpmyadmin in mysql?
How does triggers work in mysql?
What is the maximum connection pool size?
Can we store videos in mysql database?
What is normalization and list the different types of normalization?