Posted by:
dave_harding55
(---.pool1.Mansfield-NOT6900-BAS0001.orangehomedsl.co.uk)
I am having issues with displaying information from my table. I can connect fine but i keep getting this error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in C:\wamp\www\Lincoln Rugby\untitled1.php on line 22
Does anybody know why???
This is my code:
<?php
$database = "localhost"; //login to the server
$username = "dave"; //username login
$password = "*******"; //password login
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL"
;
echo "Connected to MySQL<br>";
//select a database to work with
$selected = mysql_select_db("lincolnrugby",$dbhandle)
or die("Could not select lincoln rugby"
;
$result = mysql_query("SELECT * FROM fixtures"
; //execute the SQL query and return records
while($row = mysql_fetch_array($result)){
echo "Date:".$row{'date'}."Home or Away Game:".$row{'homeawaygame'}."Home Team:".$row{'hometeam'}."Away Team:".$row{'awayteam'}."<br>"; //display the result
}
//close the connection
mysql_close($dbhandle);
?>