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 does php work with apache?
What is session in php w3schools?
Does strlen include null?
How cookies are transported from browsers to servers?
What are the main error types in php?
Is age a variable in research?
Write logic to print Floyd's triangle in PHP?
what is PDO?
How cookies are transported from servers to browsers?
Explain me what is the importance of "method" attribute in a html form?
When sessions ends?
What is the difference between md5(), crc32() and sha1() crypto on php?
What is PHP's configuration file called?
How can we access the data sent through the url with the get method?
What is use of htmlspecialchars php?