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
Why session timeout is important?
What are default session time and path?
What is the tags in PHP is not a valid way to begin and end a PHP code block?
Php says that an array is an ordered map. But how the values are ordered in an array?
Are parent constructors called implicitly inside a class constructor?
How to get ip address of a server in php?
Does session expire on closing browser?
What is mysql_fetch_array?
What are the different data types in javascript?
What is the use of curl()?
Write a program using while loop in php?
Is polymorphism inherited?
What is php addslashes?
How a constant is defined in a php script?
What is basename php?