Apache stopped working when connecting to mysql. pls help
Posted: 19. August 2009 10:25
<?php
mysql_connect(localhost,"root","******");
@mysql_select_db("test") or die( "Unable to select database");
$query="SELECT * FROM test1";
$result=mysql_query($query);
$num=mysql_numrows($result);
echo $num;
mysql_close();
?>
When I try it windows displays message "Apache stopped working..."
p.s. I used wrong password, then this works correctly and show "Unable to select database".
probably error is in mysql_query($result); or @mysql_select_db("test")
Any help would be appriciated
mysql_connect(localhost,"root","******");
@mysql_select_db("test") or die( "Unable to select database");
$query="SELECT * FROM test1";
$result=mysql_query($query);
$num=mysql_numrows($result);
echo $num;
mysql_close();
?>
When I try it windows displays message "Apache stopped working..."
p.s. I used wrong password, then this works correctly and show "Unable to select database".
probably error is in mysql_query($result); or @mysql_select_db("test")
Any help would be appriciated