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 / asheesh
database connection was not established yet that's why this
error is occuring.
$con=mysql_connect("localhost","root","password") or die
(mysql_error());
$link=mysql_select_db('test',$con);
if(!$link)
{
die(mysql_error());
}
"root" is the user name
"test" is the database name
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
How to set cookies in PHP?
How to support multiple-page forms?
What does echo mean in php?
What is basic php?
What is difference between explode() or split() in PHP?
What is php explain?
What is the delimiter syntax is PHP's default delimiter syntax
Which library is used in php to do various types of image work?
What is the use of Php variables?
How to process the uploaded files?
How do you destroy a session?
What is "print" in php?
Where do we use get and post?
What is the best php framework 2018?
What is polymorphism in php?