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 are the file upload settings in configuration file?
What are the four scalar types of php?
What is a model in php?
How can we destroy the cookie in php?
How to open a file for writing?
How long is csrf token?
What is the use of htmlentities in php?
Is strcmp case sensitive?
What is the current stable version of php? What advance thing in php7?
What is the use of nl2br() in php?
How to test if a variable is an array?
Name some of the functions in php.
How do I repair phpmyadmin?
Explain me what is the meaning of a persistent cookie?
What is the scope of a variable defined outside a function?