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
How can we connect to a mysql database from a php script?
What are the steps for the payment gateway processing?
How to register a variable in PHP session?
How variables are passed through arguments?
Where can I find php ini file?
What does $_server mean?
Is php a mvc?
Does strlen include null?
How to create a table using php?
What are the method available in form submitting?
How to access a specific character in a string?
How to access a specific character in a string using php?
What is a persistent cookie in php?
What is the super method?
How does the identity operator ===compare two values in PHP?