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 you backup a database in mysql?
How to check server status with 'mysqladmin'?
What is difference between microsoft sql and mysql?
How to create a test table in your mysql server?
What happens when the column is set to AUTO INCREMENT and if you reach maximum value in the table?
How to get a version of mysql?
Is mysql good for big data?
How to use triggers to track changes in mysql?
What does mysql flush tables do?
Explain the difference between mysql and mysql interfaces in php?
Is mysql and sql are same?
What you can use regular expression for in mysql? Support your answer with an example?
What is mysql procedure?
What is mysql in linux?
Which is faster mongodb or mysql?