Hey guys, what’s up? Today I am here to provide you some basic idea about MySQL database.
So, what is MySQL?
MySQL is a database system runs on web server. It is very fast, reliable, and easy to use. It is open-source database and free to download. It uses standard SQL. It is commonly used with PHP scripts to create powerful and dynamic website. MySQL supports many languages like Python, PERL, PHP, JAVA, C, C#, C++, Ruby & so on.
Note: MySQL version less than 5.0 doesn’t support COMMIT, stored and ROLE procedure.
ü Numeric Data Type: INT, FLOAT(m,d), DOUBLE(m,d), DECIMAL(m,d)
[total digit length (m) & number after decimals point is (d)]
ü String Data Types: CHAR(size), VARCHAR(size)
Difference between VARCHAR & CHAR:
Difference between DOUBLE & FLOAT:
DOUBLE stores floating point numbers up to 18 places & allocate 8 bytes where FLOAT stores floating point numbers up to 8 places & allocate 4 bytes.
We can establish MySQL database connection in two ways-
PHP 5+ can work with a MySQL database using PDO (PHP Data Objects) & MySQLi extension (the “i” stands for improved). MySQLi will only work with MySQL databases, on the other hand PDO will work on 12 different database systems. Prepared Statements protect from SQL injection, and are very important for web application security. Both PDO & MySQLi are object-oriented & support Prepared Statements, but MySQLi also offers a procedural API.
That’s all for today. In second part we will discuss about MySQL, MySQLi, PDO Connection using PHP Script. Thanks for being with us. Bye