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
Write a hello world program using variable?
How to pad an array with the same value multiple times?
What is final class and final method in php?
Why do we use csrf token?
What is polymorphism in php?
Do you know what is php?
What is php routing?
What are the two types of variables?
How do you end php?
Which function is used in php to check the data type of any variable?
What is the Pipe Symbol represented?
How is it possible to parse a configuration file?
Explain how we can retrieve the data in the result set of mysql using php?
How to call javascript function in php without any event?
What is $$ in php?