Fatal error: Function name must be a string in C:\.....
Posted: Wed Aug 19, 2009 1:07 am
Hi,
As i am practicing the php with mysql database in that i am getting a fatal error as follows
Connection Success!!!
Fatal error: Function name must be a string in C:\xampp\htdocs\WishList\test.php on line 28
I have created a table 'cars' in the 'test' database. I want to fetch the results from the database. But i am not getting.
Can anyone tell me why i am getting this error.
Code:
As i am practicing the php with mysql database in that i am getting a fatal error as follows
Connection Success!!!
Fatal error: Function name must be a string in C:\xampp\htdocs\WishList\test.php on line 28
I have created a table 'cars' in the 'test' database. I want to fetch the results from the database. But i am not getting.
Can anyone tell me why i am getting this error.
Code:
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
//connection parameters
$username = "root";
$password = "";
$dbhost = "localhost";
//connection to database
$dbconnection = mysql_connect($dbhost, $username, $password) or die("Could not connect to MySQL Database");
echo "Connection Success!!!";
//working with particular database
$dbhandle = mysql_select_db("test", $dbconnection) or die("Could not select the test database");
//execute query and return results
$resultsett = mysql_query("SELECT id, name, year FROM cars");
//fetch the data from the database test
while($row = mysql_fetch_array($resultsett)){
echo "ID:" .$row('id')." Name:".$row('name'). " Year:".$row('year')."<br>";
}
?>
</body>
</html>