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
What is the use of die in php?
What do you mean by having php as whitespace insensitive?
Explain why would we use === instead of ==?
Explain how we can retrieve the data in the result set of mysql using php?
What is php constructor?
How do you check if an arraylist is empty?
What is the difference server side and browser side validation?
What is htaccess? Why do we use this and where?
What is the function of trim?
What is an object in php?
Tell me what is the main difference between require() and require_once()?
What is data structure in php?
What is final keyword in php?
Explain do you use composer? If yes, what benefits have you found in it?
What are the string functions in php?