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
can you elaborate on blob and text in mysql? : Mysql dba
How to get a list of all tables in a database?
what is a cursor? : Mysql dba
How to enter boolean values in sql statements?
Write a query to find duplicate rows in table?
What is mysql and why it is used?
What is truncate command?
Tell us something about heap tables?
How do I start mysql server?
How do I connect to a database in mysql workbench?
What is pdo :: fetch_assoc?
What are queries used for?
In mysql, what is the default storage engine?
Can you tell which of the following where clauses is faster?
Explain what is mysql?