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
How to remove blank spaces from the string?
How to get a total number of rows available in the table?
i m a B.E,passed out few yrs bak failed to find good job due to less marks now thinkin of a career as PHP developer. is it a lucarative field and wat r career prospects; hv heard dat initial salary is very less bout 6k also most jobs r contrct jobs.pls guide me need ur valuable advice.pls hellppp!! thnx..
How do http requests work?
Explain Traits in PHP?
Can you give example for trait in php?
Why do you need to filter out empty files?
What are the different types of php variables?
What are php applications?
What is the function func_num_args() used for?
Tell me how to create a session? How to set a value in session? How to remove data from a session?
How to turn on the session support in php?
What is varchar mysql?
How to get ip address of a server in php?
What is mysql_fetch_array?