How will you create a mysql database using php ?

Answer Posted / modi[achir communication]

<?php

$linkid = mysql_connect("servername", "username", "password");
mysql_query("CREATE DATABASE db");
mysql_select_db("db");

mysql_query("CREATE TABLE table (...)");

?>

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is overloading possible in php?

721


How a variable is declared in php?

724


Is php case sensitive?

707


What function should you use to join array elements with a glue string?

763


How to insert a line break in php string?

740


What is the use of 'print' in php?

799


What are the advantages of php?

739


When do you use define() and when do you use const. What are the main differences between those two?

814


What is php session start?

748


What are magic methods?

734


What is a definer in mysql?

742


Tell me what is the actually used php version?

766


What is difference between print_r and echo in php?

704


Suppose we receive a form submitted by a post to subscribe to a newsletter. This form has only one field, an input text field named email. How would we validate whether the field is empty? Print a message "the email cannot be empty" in this case?

914


What are examples of independent and dependent variables?

729