Answer Posted / tina
1.mysql_connect('ip address/localhost','username for
mysql','password');
i.e
$con=mysql_connect('localhost','root','sdsd');
here,$con is a user defined variable.
2.$quer=CREATE DATABASE sampdb;
mysql_query($quer,$con);
Here,$quer is also user defined variable.
if(mysql_query($quer,$con)
{
echo("DATABASE WAS BEEN CREATED");
}
else
echo("NOT CREATED");
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is difference between static and final in php?
What does PEAR stands for?
How to return a value back to the function caller?
Do you know what is the use of rand() in php?
Explain the installation of PHP on UNIX systems?
What is composer phar?
Write down the code for saving an uploaded file in PHP.
What is the difference between explode() and split() functions?
What is Type hinting in PHP?
What is difference between print_r and echo in php?
What is difference between rest api and restful api?
What is meant by PEAR in PHP?
How many types of array supported in php?
Which function is used to strip whitespace?
Explain the different types of errors in php.