Error on the end tag?
Posted: Wed Mar 03, 2010 12:58 am
PHP is complaining about a parse error on line 71. The contents of that line is:
The whole file is below:
Code: Select all
?>Code: Select all
<?php
// mysql includes
// define mysql database parameters
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', 'cms');
//start_sql()
//sets up the sql database for use
//returns nothing
function start_sql() {
//Array to store validation errors
$errmsg_arr = array();
//Validation error flag
$errflag = false;
//Connect to mysql server
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
die('Failed to connect to server: ' . mysql_error());
}
//Select database
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
die("Unable to select database");
};
//getconfig($configname)
//returns the value of the config name specified from the database
function getconfig($configname) {
//Create query
$qry="SELECT * FROM config WHERE name=$configname";
$result=mysql_query($qry);
//Check whether the query was successful or not
if($result) {
if(mysql_num_rows($result) == 1) {
$res1 = mysql_fetch_assoc($result);
return $res1['value'];
exit();
} else {
return 1;
}
}else {
die("Query failed");
}
};
//getpage($page_id)
//returns the mysql row of the page id specified
function getpage($page_id) {
//Create query
$qry="SELECT * FROM config WHERE name=$configname";
$result=mysql_query($qry);
//Check whether the query was successful or not
if($result) {
if(mysql_num_rows($result) == 1) {
return $result;
exit();
} else {
return 1;
}
}else {
die("Query failed");
}
};
?>