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 the purpose of -> in the mysql terminal?
How do I enable mysqli extension?
Explain Access Control Lists.
What is difference between unix timestamp and mysql timestamp?
What is row?
What is an example of a delimiter?
Is sql similar to mysql?
Does mysql use t sql?
How can we change the data type of a column of a table?
How do I stop a mysql service?
How show all tables in mysql query?
What is mysql command line?
How do you know if your mysql server is alive?
How does php communicate with mysql?
How do you name a table?