I really need your help.
I'm starting learning php on my stand alone computer, using php4 and pws. the localhost name is 'ihsan' . but i always get trouble to connect to mysql . below is the error message and my php code.
thanks alot
Warning: MySQL Connection Failed: Can't connect to MySQL server on 'ihsan' (10061) in C:\Inetpub\wwwroot\index.php on line 18
<?
$database="shopping";
$hostname="ihsan";
$username="root";
$password="";
if (!$dbh=mysql_connect($hostname,$username,$password))
{
echo mysql_error();
exit();
}
mysql_select_db($database,$dbh);
$sql="select type, name, image_path from category_types";
if(!$res=mysql_query($sql,$dbh))
{
echo mysql_error();
exit();
}
while($row=mysql_fetch_row($res))
{
echo "<tr>";
echo "<td><img src=http://www.phpbuilder.com/board/archive/index.php/$row[2]>";
echo "<td><a href=category.php?type=$row[0]>$row[1]</a>";
}
?>
I'm starting learning php on my stand alone computer, using php4 and pws. the localhost name is 'ihsan' . but i always get trouble to connect to mysql . below is the error message and my php code.
thanks alot
Warning: MySQL Connection Failed: Can't connect to MySQL server on 'ihsan' (10061) in C:\Inetpub\wwwroot\index.php on line 18
<?
$database="shopping";
$hostname="ihsan";
$username="root";
$password="";
if (!$dbh=mysql_connect($hostname,$username,$password))
{
echo mysql_error();
exit();
}
mysql_select_db($database,$dbh);
$sql="select type, name, image_path from category_types";
if(!$res=mysql_query($sql,$dbh))
{
echo mysql_error();
exit();
}
while($row=mysql_fetch_row($res))
{
echo "<tr>";
echo "<td><img src=http://www.phpbuilder.com/board/archive/index.php/$row[2]>";
echo "<td><a href=category.php?type=$row[0]>$row[1]</a>";
}
?>