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 the content of /etc directory?
How can we submit form without a submit button?
How to Retrieve the Session ID of the Current Session?
What is the difference between for and foreach loop in php?
Who is the father of php and what is the current version of php and mysql?
What is php static function?
Is php easy language to learn?
Can constructor be private in php?
Which operator is used to concatenate two strings in PHP?
What is inheritance in php?
Do you know what is the function mysql_pconnect() usefull for?
So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?
How to get the length of string?
Is it possible to use com component in php?
Are sessions stateless?