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
What is datadir?
Use a regular expression to find records. Use “REGEXP BINARY” to force case-sensitivity. This finds any record beginning with r.
What are date and time data types in mysql?
Is mysql a nosql database?
Which datatype is used for email in mysql?
What is user in mysql?
Can we create table in stored procedure?
Why we use mongodb instead of mysql?
How does triggers work in mysql?
What is the query to display top 20 rows?
what is the difference between gui testing and database testing? : Mysql dba
What are mysql queries?
What is the difference between procedure and function in mysql?
What is mysql used for?
What is mysql community server?