adspace
Answer Posted / Jinkal Chaudhary
To connect a MySQL database with PHP, you can use functions like `mysql_connect()` or the more modern `PDO` (PHP Data Objects) and MySQLi (MySQL Improved Extension). With `mysql_connect()`, you provide the hostname, username, password, and database name as arguments. For PDO, you create a new instance of it and call `setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION)` to handle errors.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers