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 increment dates by 1 in mysql?
What are the indexes in mysql?
Are stored procedures precompiled?
What do you mean by % and _ in the LIKE statement?
How many columns is too many mysql?
What is a join? Explain the different types of mysql joins.
What is unsigned in mysql?
Transactions are used to treat sets of SQL statements atomically. State Whether True or False?
How do I restart mysql on windows?
How to show table names with 'mysqlshow'?
How to create and drop view in mysql?
What is delimiter in mysql trigger?
Why do you think it is advised to not to use guid and character columns as clustered index arrays?
What is longblob?
How to convert character strings to numeric values?