Try this instead:
<?php
$database="Flowhill";
$db = @mysql_connect "localhost","flowhill");
$cn=@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM test";
$result=mysql_query($query);
$first=mysql_result($result,$i,"forename");
mysql_close();
?>
Rob wrote:
I am using the following code
<?php
$database="Flowhill";
$db = mysql_connect("localhost","flowhill");
$cn=mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM test";
$result=mysql_query($query);
$first=mysql_result($result,$i,"forename");
mysql_close();
?>
I keep getting Unable to select database returned in my browser when I upload the above, give extension .php3 and call up in browser.
Any ideas where I am going wrong? The database is called Flowhill (I've double checked and checked again), the user name is flowhill, and the table is called test. There are 4 fields in the table, one is called forename. There is only one record in the table, and the forename field contains the word Rob.
Any help appreciated. Really frustrated at falling at the first hurdle.