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 to Change a users password from MySQL prompt. Login as root. Set the password. Update privs.
Is mysql a distributed database?
What is full form of xampp?
How do I edit a table in mysql workbench?
What is delimiter in mysql trigger?
What is blob datatype in mysql?
What is delimiter $$?
How to use regular expression in pattern match conditions?
Is mysql easy to learn?
Which is better mysql or mssql?
What are the functions of commit and rollback statements?
What is timestamp in mysql?
How do I copy a table in mysql?
Is mongodb faster than mysql?
Can foreign key have duplicate values?