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
How to include variables in double-quoted strings?
When is a conditional statement ended with endif?
Tell me how can we change the maximum size of the files to be uploaded?
What is the use of htmlspecialchars in php?
Which database is best for php?
What are the advantages of indexes?
How to select a database?
Is php case sensitive?
Do while loops php?
Can the value of a constant change during the script's execution?
Why overriding is called runtime polymorphism?
Is nan in php?
Explain what is meant by pear in php?
How can we execute a php script using command line?
How many types of inheritances used in php and how we achieve it.