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
Explain difference between urlencode and urldecode?
What are the benefits of composer?
How to get the position of the character in a string in php?
What is the difference between rest and soap?
Which php framework is in demand?
Does csrf token change?
What are the differences between session and cookie?
Is php better than java?
What are the steps involved to run php?
What is cURL in PHP?
How to count all the lines of code in a directory and sub folder?
How can image properties be retrieved in php?
How to convert a json string to an array in php?
Which operator is used to concatenate two strings in PHP?
Does empty check for null?