Hi. I've got a page which comes at the end of a 3 page sequence - search, results, detail. The detail page had been working fine, but yesterday I added a second recordset to the page, to pull reviews from a separate table, and now I'm getting the following error:
Parse error: syntax error, unexpected ')', expecting T_STRING or T_VARIABLE or '$' in /Applications/MAMP/htdocs/goodvetguide/practice_Detail.php on line 78
(should point out that I'm using DMW8 on a Mac and testing locally using MAMP as my testing server).
$Parampractice_id_WADApracticelist = (get_magic_quotes_gpc()) ? : addslashes();
and the full code for the page is posted below. I've googled this error and found a variety of different reasons for why this might be happening but none of the examples I've seen appear to apply to my case, so I'd really appreciate any assistance anyone can offer with this. Thanks in advance.
<?php require_once('Connections/connGVG.php'); ?>
<?php require_once('Connections/connGVG.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?><?php
if (!session_id()) session_start();
?>
<?php
$Parampractice_WADApracticelist = "-1";
if (isset($_GET['practice_id'])) {
$Parampractice_WADApracticelist = (get_magic_quotes_gpc()) ? $_GET['practice_id'] : addslashes($_GET['practice_id']);
}
$ParamSessionpractice_WADApracticelist = "-1";
if (isset($_SESSION['WADA_Insert_practicelist'])) {
$ParamSessionpractice_WADApracticelist = (get_magic_quotes_gpc()) ? $_SESSION['WADA_Insert_practicelist'] : addslashes($_SESSION['WADA_Insert_practicelist']);
}
$Parampractice_WADApracticelist = "-1";
if (isset($_GET['practice_id'])) {
$Parampractice_WADApracticelist = (get_magic_quotes_gpc()) ? $_GET['practice_id'] : addslashes($_GET['practice_id']);
}
$Parampractice_id_WADApracticelist = "-1";
if (isset()) {
$Parampractice_id_WADApracticelist = (get_magic_quotes_gpc()) ? : addslashes();
}
$Parampractice_id2_WADApracticelist = "-1";
if (isset()) {
$Parampractice_id2_WADApracticelist = (get_magic_quotes_gpc()) ? : addslashes();
}
$ParamSessionpractice_id_WADApracticelist = "-1";
if (isset()) {
$ParamSessionpractice_id_WADApracticelist = (get_magic_quotes_gpc()) ? : addslashes();
}
mysql_select_db($database_connGVG, $connGVG);
$query_WADApracticelist = sprintf("SELECT practice_id, practicename, address1, address2, address3, address4, postcode, location, practicewebsite, practicetype, starrating FROM practicelist WHERE practice_id = %s OR ( -1= %s AND practice_id= %s)", GetSQLValueString($Parampractice_id_WADApracticelist, ""),GetSQLValueString($Parampractice_id2_WADApracticelist, ""),GetSQLValueString($ParamSessionpractice_id_WADApracticelist, ""));
$WADApracticelist = mysql_query($query_WADApracticelist, $connGVG) or die(mysql_error());
$row_WADApracticelist = mysql_fetch_assoc($WADApracticelist);
$totalRows_WADApracticelist = mysql_num_rows($WADApracticelist);
$colname_rsReviews = "-1";
if (isset($_GET['WADALocation'])) {
$colname_rsReviews = (get_magic_quotes_gpc()) ? $_GET['WADALocation'] : addslashes($_GET['WADALocation']);
}
mysql_select_db($database_connGVG, $connGVG);
$query_rsReviews = sprintf("SELECT * FROM reviews WHERE practice_id = %s", GetSQLValueString($colname_rsReviews, "int"));
$rsReviews = mysql_query($query_rsReviews, $connGVG) or die(mysql_error());
$row_rsReviews = mysql_fetch_assoc($rsReviews);
$totalRows_rsReviews = mysql_num_rows($rsReviews);
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Details practicelist</title>
<style type="text/css">
<!--
-->
</style>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="WA_DataAssist/styles/Refined_Pacifica.css" rel="stylesheet" type="text/css" />
<link href="WA_DataAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
<style type="text/css">
/* Details page CSS */
.WADADetailsContainer {
font-size: 11px;
}
#WADADetails {
padding-top: 10px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="header"></div>
<div id="content">
<div id="menu">
<a href="addreview.html">Add review</a> <a href="contact.html">Contact</a> <a href="terms.html">Terms</a> <a href="practice_Search.php">Search</a> <a href="about.html">About </a><a href="index.html">Home </a></div>
<div id="contentleft2">
<div id="greenpiccont"></div>
<div id="cright">
<div class="boldwhite" id="rightblue">Review your vet<br />
<br />
<span class="smallbold">Tell us your experience</span><br />
<br />
<span class="smallwhite">Give people information<br />
on your experiences so <br />
that they can make an<br />
informed decision.</span><br />
<div id="startbutton"><a href="#">Start</a></div>
</div>
<div id="bluemap2"></div>
<div id="searchbox">
<table width="202" border="0" cellspacing="0">
<tr>
<th scope="row"><div align="left" class="smalltext">Search by postcode</div></th>
</tr>
<tr>
<th height="31" scope="row"><input name="Name" class="Width250px" /></th>
</tr>
<tr>
<th scope="row"><div align="left" class="smalltext">Miles</div></th>
</tr>
<tr>
<th height="39" scope="row"><div align="left">
<input name="Name2" class="Width250px" />
</div></th>
</tr>
</table>
</div>
</div>
<div class="about10" id="contl">Practice details<br />
<div class="WADADetailsContainer"> <a name="top"></a>
<div class="WADAHorizLine"><img src="WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<?php if ($totalRows_WADApracticelist > 0) { // Show if recordset not empty ?>
<div id="WADADetails">
<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th class="WADADataTableHeader">Practice name:</th>
<td class="WADADataTableCell"><strong><?php echo($row_WADApracticelist['practicename']); ?></strong></td>
</tr>
<tr>
<th class="WADADataTableHeader">Practice type:</th>
<td class="WADADataTableCell"><?php echo($row_WADApracticelist['practicetype']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader">Address:</th>
<td class="WADADataTableCell"><?php echo($row_WADApracticelist['address1']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader"> </th>
<td class="WADADataTableCell"><?php echo($row_WADApracticelist['address2']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader"> </th>
<td class="WADADataTableCell"><?php echo($row_WADApracticelist['address3']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader"> </th>
<td class="WADADataTableCell"><?php echo($row_WADApracticelist['address4']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader">Postcode:</th>
<td class="WADADataTableCell"><?php echo($row_WADApracticelist['postcode']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader">Location:</th>
<td class="WADADataTableCell"><?php echo($row_WADApracticelist['location']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader">Website:</th>
<td class="WADADataTableCell"><a href="
http://www.<?php echo $row_WADApracticelist['practicewebsite']; ?>" target="_blank"><?php echo($row_WADApracticelist['practicewebsite']); ?></a></td>
</tr>
<tr>
<th class="WADADataTableHeader">Star rating:</th>
<td class="WADADataTableCell"><?php echo($row_WADApracticelist['starrating']); ?></td>
</tr>
</table>
<div class="WADAHorizLine"><img src="WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<div class="WADAButtonRow">
<table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="WADADataNavButtonCell" nowrap="nowrap"></td>
<td class="WADADataNavButtonCell" nowrap="nowrap"></td>
<td class="WADADataNavButtonCell" nowrap="nowrap"><a href="practice_Results.php" title="Results"><img border="0" name="Results" id="Results" alt="Results" src="WA_DataAssist/images/Pacifica/Refined_results.gif" /></a></td>
</tr>
</table>
</div>
</div>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_WADApracticelist == 0) { // Show if recordset empty ?>
<div class="WADANoResults">
<div class="WADANoResultsMessage">No record found.</div>
</div>
<div class="WADAHorizLine"><img src="WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<div class="WADADetailsLinkArea">
<div class="WADADataNavButtonCell"><a href="practice_Results.php" title="Results"><img border="0" name="Results1" id="Results1" alt="Results" src="WA_DataAssist/images/Pacifica/Refined_results.gif" /></a></div>
</div>
<div class="WADAHorizLine"><img src="WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div><p><strong>Reviews for this practice:</strong></p>
<?php do { ?>
<table width="100%" border="0" cellspacing="5" cellpadding="2">
<tr>
<td width="23%"> </td>
<td width="77%"><?php echo $row_rsReviews['comments']; ?></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<?php } while ($row_WADApracticelist = mysql_fetch_assoc($WADApracticelist)); ?>
<?php } // Show if recordset empty ?>
</div>
</div>
</div>
<div id="contentright">
<p> </p>
</div>
</div>
<div class="clr"></div>
<div id="footer">hj</div>
</div>
</body>
</html>
<?php
mysql_free_result($WADApracticelist);
mysql_free_result($rsReviews);
?>