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

What is difference between include,require,include_once and require_once()?

532


Explain the different types of errors in php.

531


What is design pattern? Explain all including singleton pattern?

543


List some sorting functions in php?

550


Why php script is not running in browser?

567






What is php regular expression?

508


What types of loops exist in php?

546


List functions available to sort an php array?

549


Which is the latest version of php?

549


What is the difference between explode () and split () functions in php?

616


Can we override magic methods in php?

537


What is namespaces in PHP?

554


How to convert a character to an ascii value?

564


Does strlen include null?

586


Tell me what does pear stands for?

557