i got this error msg in online... how to solve this
problem... i couldnot find out as soon as possible send me
answer or idea
COULD NOT ABLE TO CONNECT DATABASE .
Can't connect to local MySQL server through socket
'/usr/local/mysql-5.0/data/mysql.sock' (2)
Answer Posted / ritu
First you have to make a database connection. coding is below mention:
first u have to create a connection to server like:
mysql_connect("localhost","root","");
then select the database like:
mysql_select_db("database_name");
localhost is default server name.
root is default user name.
"" is default password. it means password is blank.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is dao in php?
How are sessions maintained?
How to return a value back to the function caller?
What does a special set of tags do in php?
How to call javascript function in php on button click?
Do you know how to enable error reporting in php?
Explain me what is the difference between explode() and split() functions?
How to create a public static method in PHP?
What is repository in php?
Explain the three different kinds of Arrays?
Explain preg_Match and preg_replace?
How does php strcmp work?
What is the use of mvc in php?
What is mean by an associative array?
What is the function file_get_contents() useful for?