What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?

Mysql_fetch_object is used to retrieve the result from the database as objects, while mysql_fetch_array returns result as an array. This will allow access to the data by the field names. For example: Using mysql_fetch_object field can be accessed as $result->name. Using mysql_fetch_array field can be accessed as $result->[name]. Using mysql_fetch_row($result) where $result is the result … Read more

What are the advantages of MyISAM over InnoDB?

MyISAM follows a conservative approach to disk space management and stores each MyISAM table in a separate file, which can be further compressed if required. On the other hand, InnoDB stores the tables in the tablespace. Its further optimization is difficult. The advantages of MyISAM over InnoDB include: Simplicity: MyISAM is simpler to design and … Read more

What is the usage of ENUMs in MySQL?

ENUMs are string objects. By defining ENUMs, we allow the end-user to give correct input as in case the user provides an input that is not part of the ENUM defined data, then the query won’t execute, and an error message will be displayed which says “The wrong Query”. For instance, suppose we want to … Read more

How is the MyISAM table stored?

MyISAM table is stored on disk in three formats. ‘.frm’ file : storing the table definition ‘.MYD’ (MYData): data file ‘.MYI’ (MYIndex): index file MyISAM tables in MySQL are stored as three types of files on the disk: .frm file: This file stores the table definition. .MYD file: This file contains the data. .MYI file: … Read more

What is the default port of MySQL Server?

The default port of MySQL Server is 3306. The default port for MySQL Server is 3306.