How to create connection in php?
Answer / Ravi Dhawan
To create a connection in PHP, you can use the PDO (PHP Data Objects) extension or mysqli extension. Here's an example using PDO:
```php
$db = new PDO('mysql:host=localhost;dbname=database_name', 'username', 'password');
```
| Is This Answer Correct ? | 0 Yes | 0 No |
How many ways to include array elements in double-quoted strings using php?
What does $_server mean?
How do you compare strings in java?
What are the advantages and disadvantages of cascade style sheets?
What software is required to run php?
How escape single quotes php?
What is the use of nl2br() in php?
What is the method to execute a php script from the command line?
How session works (internal processing of session) ?
3 Answers ASD Lab, IPSR Solutions,
Tell me how can you pass a variable by reference?
Does php pass arrays by reference?
What are the different methods of passing data or information between two calls of a web page? What are the advantages/disadvantages of these methods?