Hi,
I am new to PHP and mysql please help me solve this problem.I can use telnet and access mysql without any problems
I can create tables in telnet.
but when i write a php code and run it i get the following error msge
"Warning: MySQL Connection Failed: Can't connect to MySQL server on 'evaltech.com' (111) /usr/local/etc/httpd/htdocs/jokes.php on line 10 "
This is my php program and the username and password is worrect I verified mysql using telnet
<HEAD>
<TITLE> Our List of Jokes </TITLE>
<HEAD>
<BODY>
<?php
// Connect to the database server
$dbcnx = mysql_connect("evaltech.com","evaltech","evaltech");
if (!$dbcnx)
{
echo( "<P>Unable to connect to the " ."database server at this time.</P>" );
exit();
}
// Select the jokes database
if (! @mysql_select_db("jokes") )
{
echo( "<P>Unable to locate the joke " ."database at this time.</P>" );
exit();
}
?>
<P> Here are all the jokes in our database: </P>
<BLOCKQUOTE>
<?php
// Request the text of all the jokes
$result = mysql_query("SELECT JokeText FROM Jokes");
if (!$result)
{
echo("<P>Error performing query: " . mysql_error() . "</P>");
exit();
}
// Display the text of each joke in a paragraph
while ( $row = mysql_fetch_array($result) )
{
echo("<P>" . $row["JokeText"] . "</P>");
}
?>