Difference between MYSQL_ASSOC,MYSQL_NUM and MYSQL_BOTH ?

Answers were Sorted based on User's Feedback



Difference between MYSQL_ASSOC,MYSQL_NUM and MYSQL_BOTH ?..

Answer / 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

Difference between MYSQL_ASSOC,MYSQL_NUM and MYSQL_BOTH ?..

Answer / deepak sakure

difference between MYSQL_NUM AND MYSQL_ASSOC.
MYSQL_NUM returns a numerically indexed array.
MYSQL_ASSOC returns an associative array.

Is This Answer Correct ?    20 Yes 3 No

Difference between MYSQL_ASSOC,MYSQL_NUM and MYSQL_BOTH ?..

Answer / test

difference between MYSQL_NUM AND MYSQL_ASSOC.
MYSQL_NUM returns a numerically indexed array.
MYSQL_ASSOC returns an associative array.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More MySQL Interview Questions

What are the functions used to encrypt and decrypt the data present in mysql?

0 Answers  


Is mysql port 3306 tcp or udp?

0 Answers  


What is difference between mongodb and mysql?

0 Answers  


How do you stop an access query?

0 Answers  


What is a storage engine? What are the differences between innodb and myisam engines?

0 Answers  


Can mysql store files?

0 Answers  


Can you tell how many values can set the function of mysql to consider?

0 Answers  


What are the differences between mysql vs sql server?

0 Answers  


What is the maximum no of columns a table can have?

0 Answers  


Explain federated tables?

3 Answers   Tech Mahindra,


What is mvcc in mysql?

0 Answers  


What are the functions of commit and rollback statements?

0 Answers  


Categories