How to create a mysql connection in php?



How to create a mysql connection in php?..

Answer / Deepak Nigam

To create a MySQL connection in PHP, you can use the mysqli extension. Here is an example: $conn = new mysqli('localhost', 'username', 'password', 'database_name');

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

How php statement is different from php script?

1 Answers  


What is the difference between print() and echo()?

1 Answers  


What is the difference between array_map () and array_shift ()?

1 Answers  


what is benefit of magento?

1 Answers  


How can you get, the total size of a certain directory?

1 Answers  


Can we override static method?

1 Answers  


What type of headers have to be added in the mail function to attach a file?

1 Answers  


Tell me how can I display text with a php script?

1 Answers  


What is difference between $x and $$x

5 Answers   Mindex, Net Solution, Procon IT Solutions, Trigent,


Explain me what are the main error types in php and how do they differ?

1 Answers  


What is variable declaration?

1 Answers  


How can we create a database using php?

1 Answers  


Categories