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 the meaning of php?
How do you create an array in php?
What is isset in php form?
What is php session and how it works?
Who is known as the father of php?
Can I learn php without knowing c?
What is magic function in php?
Where do I run php code?
How to create a public static method in PHP?
What are helpers in php?
What websites use php?
How to get number of elements in an array?
Which function is used to strip whitespace?
What does php exit do?
Tell me how can we get the error when there is a problem to upload a file?