Thanks my PhpMyAdmin is working perfectly fine now.
Now I am getting the following error when I run the code below:
ERROR--->Unable to select database: Unknown database 'test'
where 'Test' is the database name and 'greendb' is the required table in that.
//CODE
<html>
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'vartika';
$db = mysql_connect($dbhost, $dbuser, $dbpass)
or die ("Unable to connect: " . mysql_error());
mysql_select_db ("Test"
or die ("Unable to select database: " . mysql_error());
$query = "SELECT * FROM greendb";
$rs = mysql_query ($query, $db)
or die ("Query failed: " . mysql_error() . " Actual query: " . $query);
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
print_r($row);
}
}
?>
</html>