Difference between MYSQL_ASSOC,MYSQL_NUM and MYSQL_BOTH ?
Answer Posted / 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 |
Post New Answer View All Answers
How do I create a mysql database?
What is difference between schema and table?
What is unsigned in mysql?
What are the different tables present in MySQL?
How is mysql database stored?
What does it mean to be case sensitive?
Is mysqli secure?
How can you count the total number of records of any table?
What are the steps required to view your mysql database?
Why mysql is used with php?
How do you determine the location of mysql data directory?
How to store values to array from mysql database in php?
Which is faster innodb or myisam?
What is the datatype of image in mysql?
How to determine the location of the data directory?