Parse error: syntax error, unexpected T_ELSE in
Posted: Mon Feb 23, 2009 7:31 am
hi,
i want to add in different colors to the rows and the thing works fine when there are records but doesn't when there are none - as i get a table headings...
Parse error: syntax error, unexpected T_ELSE in /home/allresta/public_html/Alabama/alabaster.php on line 106
i want to add in different colors to the rows and the thing works fine when there are records but doesn't when there are none - as i get a table headings...
Parse error: syntax error, unexpected T_ELSE in /home/allresta/public_html/Alabama/alabaster.php on line 106
Code: Select all
<?php
// technocurve arc 3 php bv block1/3 start
$color1 = "#99cc33";
$color2 = "#ccff99";
$color = $color1;
// technocurve arc 3 php bv block1/3 end
?><?php require_once('../Connections/myconn.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;
}
}
mysql_select_db($database_myconn, $myconn);
$query_Recordset1 = "SELECT Restaurant, Website, `Description`, URL FROM Alabama WHERE URL = 'http://www.foo-bar.com/Alabama/alabaster.php' ORDER BY Restaurant ASC";
$Recordset1 = mysql_query($query_Recordset1, $myconn) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Alabaster Restaurants</title>
<meta name="keywords" content="Alabaster Restaurants" />
<meta name="description" content="Find a restaurant inAlabaster;the US state of Alabama Why not add your restaurant to the list?" />
<link href="../style/usa.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- start header -->
<div id="header">
<div id="logo">
<h1><a href="#">foo-bar.com</a></h1>
</div>
<div id="menu">
<ul>
<li><a href="http://www.foo-bar.com/index.html">Home</a></li>
<li><a href="http://www.foo-bar.com/restaurant-articles/index.php">Restaurant Articles</a></li>
<li><a href="http://www.foo-bar.com/recipes/index.php">Recipes</a></li>
</ul>
</div>
</div>
<div id="headerbg" align="center"><span style="white-space: nowrap" margin-top: "20px"><img src="../state-images/alabama.jpg" alt="state of alabama"><img src="../recipes/images/main-meals.jpg" width="450" height="209" /></span></div>
<div id="page">
<!-- start content -->
<div id="content">
<!-- start latest-post -->
<div id="latest-post" class="post">
<h1 class="title">Alabaster Restaurants</h1>
<div class="entry">
<?php
if ( $totalRows_Recordset1 > 0 ) {
echo '<table width="580" border="0" cellspacing="0" cellpadding="0"><tr><td><h2>Restaurant</h2></td><td><h2>Description</h2></td><td><h2>Report</h2></td></tr>';?>
<?php do { ?>
<tr <?php
// technocurve arc 3 php bv block2/3 start
echo " style=\"background-color:$color\"";
// technocurve arc 3 php bv block2/3 end
?>>
<td><a href="http://<?php echo $row_Recordset1['Website']; ?>" target="_blank" rel="nofollow"><?php echo $row_Recordset1['Restaurant']; ?></a></td>
<td><?php echo $row_Recordset1['Description']; ?></td>
<td><a href="mailto:reportabuse@foo-bar.com?subject=<?php echo $row_Recordset1['URL']; ?>">Report Abuse</a></td>
</tr>
<?php
// technocurve arc 3 php bv block3/3 start
if ($color == $color1) {
$color = $color2;
} else {
$color = $color1;
}
// technocurve arc 3 php bv block3/3 end
?>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
<?php echo '</table>'; ?>
<?php echo '<p>Do you want to <a href="../advertise-your-restaurant.php">advertise your restaurant</a> in the town of Alabaster?</p>'; ?>;
<?php } ?>
<?php else { ?>
<?php echo '<p>Do you want to <a href="../advertise-your-restaurant.php">advertise your restaurant</a> in the town of Alabaster?</p>'; ?>;
<?php }?>
</div>
</div>
<!-- end latest-post -->
<!-- start recent-posts -->
<div id="recent-posts">
<div class="post">
<h2 class="title">Restaurant Articles</h2>
<p>Buying A Restaurant</p>
<div class="entry">
<p><a href="../restaurant-articles/buying-a-restaurant.php" class="more">Read more</a></p>
</div>
</div>
<div class="post">
<h2 class="title">Recipe</h2>
<p>Cajun Chicken Wings</p>
<div class="entry">
<p><a href="http://www.foo-bar.com/recipes/cajun-chicken-wings.php" class="more">Read more</a></p>
</div>
</div>
<div class="post">
<h2 class="title">Business Plan</h2>
<p>Seafood Restaurant</p>
<div class="entry">
<p><a href="http://www.businessplanning-4-you.com/business-plans/Seafood-Restaurant-Business-Plan.html" class="more">Read more</a></p>
</div>
</div>
</div>
<!-- end recent-posts -->
</div>
<!-- end content -->
<!-- start sidebar -->
<div id="sidebar">
<ul>
<li>
<ul>
<li><a href="http://www.foo-bar.com/Alabama/index.php">Alabama</a></li>
<li><a href="http://www.foo-bar.com/Alaska/index.php">Alaska</a></li>
<li><a href="http://www.foo-bar.com/Arizona/index.php">Arizona</a></li>
<li><a href="http://www.foo-bar.com/Arkansas/index.php">Arkansas</a></li>
<li><a href="http://www.foo-bar.com/California/index.php">California</a></li>
<li><a href="http://www.foo-bar.com/Colorado/index.php">Colorado</a></li>
<li><a href="http://www.foo-bar.com/Connecticut/index.php">Connecticut</a></li>
<li><a href="http://www.foo-bar.com/Delaware/index.php">Delaware</a></li>
<li><a href="http://www.foo-bar.com/Florida/index.php">Florida</a></li>
<li><a href="http://www.foo-bar.com/Georgia/index.php">Georgia</a></li>
<li><a href="http://www.foo-bar.com/Hawaii/index.php">Hawaii</a></li>
<li><a href="http://www.foo-bar.com/Idaho/index.php">Idaho</a></li>
<li><a href="http://www.foo-bar.com/Illinois/index.php">Illinois</a></li>
</ul>
</li>
<li>
<ul>
<li><a href="http://www.foo-bar.com/Indiana/index.php">Indiana</a></li>
<li><a href="http://www.foo-bar.com/Iowa/index.php">Iowa</a></li>
<li><a href="http://www.foo-bar.com/Kansas/index.php">Kansas</a></li>
<li><a href="http://www.foo-bar.com/Kentucky/index.php">Kentucky</a></li>
<li><a href="http://www.foo-bar.com/Louisiana/index.php">Louisiana</a></li>
<li><a href="http://www.foo-bar.com/Maine/index.php">Maine</a></li>
<li><a href="http://www.foo-bar.com/Maryland/index.php">Maryland</a></li>
<li><a href="http://www.foo-bar.com/Massachusetts/index.php">Massachusetts</a></li>
<li><a href="http://www.foo-bar.com/Michigan/index.php">Michigan</a></li>
<li><a href="http://www.foo-bar.com/Minnesota/index.php">Minnesota</a></li>
<li><a href="http://www.foo-bar.com/Mississippi/index.php">Mississippi</a></li>
<li><a href="http://www.foo-bar.com/Missouri/index.php">Missouri</a></li>
<li><a href="http://www.foo-bar.com/Montana/index.php">Montana</a></li>
</ul>
</li>
<li>
<ul>
<li><a href="http://www.foo-bar.com/Nebraska/index.php">Nebraska</a></li>
<li><a href="http://www.foo-bar.com/Nevada/index.php">Nevada</a></li>
<li><a href="http://www.foo-bar.com/New-Hampshire/index.php">New Hampshire</a></li>
<li><a href="http://www.foo-bar.com/New-Jersey/index.php">New Jersey</a></li>
<li><a href="http://www.foo-bar.com/New-Mexico/index.php">New Mexico</a></li>
<li><a href="http://www.foo-bar.com/New-York/index.php">New York</a></li>
<li><a href="http://www.foo-bar.com/North-Carolina/index.php">North Carolina</a></li>
<li><a href="http://www.foo-bar.com/North-Dakota/index.php">North Dakota</a></li>
<li><a href="http://www.foo-bar.com/Ohio/index.php">Ohio</a></li>
<li><a href="http://www.foo-bar.com/Oklahoma/index.php">Oklahoma</a></li>
<li><a href="http://www.foo-bar.com/Oregon/index.php">Oregon</a></li>
<li><a href="http://www.foo-bar.com/Pennsylvania/index.php">Pennsylvania</a></li>
</ul>
</li>
<li>
<ul>
<li><a href="http://www.foo-bar.com/Rhode-Island/index.php">Rhode Island</a></li>
<li><a href="http://www.foo-bar.com/South-Carolina/index.php">South Carolina</a></li>
<li><a href="http://www.foo-bar.com/South-Dakota/index.php">South Dakota</a></li>
<li><a href="http://www.foo-bar.com/Tennessee/index.php">Tennessee</a></li>
<li><a href="http://www.foo-bar.com/Texas/index.php">Texas</a></li>
<li><a href="http://www.foo-bar.com/Utah/index.php">Utah</a></li>
<li><a href="http://www.foo-bar.com/Vermont/index.php">Vermont</a></li>
<li><a href="http://www.foo-bar.com/Virginia/index.php">Virginia</a></li>
<li><a href="http://www.foo-bar.com/Washington/index.php">Washington</a></li>
<li><a href="http://www.foo-bar.com/West-Virginia/index.php">West Virginia</a></li>
<li><a href="http://www.foo-bar.com/Wisconsin/index.php">Wisconsin</a></li>
<li><a href="http://www.foo-bar.com/Wyoming/index.php">Wyoming</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<div style="clear: both;"> </div>
</div>
<!-- end sidebar -->
</div>
<!-- end page -->
<div id="footer">
<p id="legal">©2008 All Restaurants USA. All Rights Reserved.</p>
<p id="links"><a href="http://www.foo-bar.com/index.php">Home</a> | <a href="http://www.foo-bar.com/terms.php">Terms</a> | <a href="http://www.foo-bar.com/faq.php">FAQ</a> | <a href="http://www.foo-bar.com/contact.php">Contact Us</a></p>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>