How can we create a database using PHP and mysql?
Answer Posted / sunil kumar
It`s simple than above
<?php
mysql_connect("localhost","root","");//connect to host
$sql_create_db="create database my_db";
if(mysql_query($sql_create_db))
echo"Database is created";
else
echo"Error in creating Database".mysql_error();
?>
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is mysqli_query?
How cookies are transported from browsers to servers?
Explain what are the two main string operators?
What is the role of php?
What are the correct and the most two common way to start and finish a PHP block of code?
Which php framework is best?
Why are sessions used?
Require_once(), require(), include(). What is difference between them?
What is the current stable version of php? What advance thing in php7?
Is salary fixed or variable cost?
Explain the advantages of using PHP?
What is the use of $_server and $_env?
Why php was called as personal home page?
How to replace a substring in a given string in php?
How do you connet mysql database with php?