Can anyone please tell me where I am going wrong? I am using a fairly standard pre-made template from my hosting company. Also I am using RVsitebuilder in cPanel to modify the template. I have a MySQL database which has two tables (nothing complex) which I want to show data from the table in a page on the site. The code I am using to connect to the database and retieve data is as follows:
<?php
$username = "eachfrie_bk";
$password = "weathervane65";
$hostname = "localhost";
//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("eachfrie_Events",$dbhandle)
or die("Could not select eachfrie_Events");
//execute the SQL query and return records
$result = mysql_query("SELECT eventid, eventname, eventlocation, eventdate, coordinator FROM tblEvents");
//fetch tha data from the database
while ($row = mysql_fetch_array($result)) {
echo "eventid:".$row{'eventid'}." Name:".$row{'eventname'}." Location:".$row{'eventlocation'." Date:".$row{'eventdate'}." Coordinator:".$row{'coordinator'}."<br>"
}
?>
</p>
When I publish and test the page (current.php) I get the follwing error message:
Parse error: syntax error, unexpected $end in /home/eachfrie/public_html/Current.php on line 189
Line 190 is simply a closing </html> tag
I am not sure if it helps but the opening code for the page is:
<?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>EACH Friends Group Peterborough</title>.......
I would very appreciate some help and guidance please.