"Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in X on line 146" problem.. Need expert help plss... here is the code..

<?php require_once('Connections/reservations.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;
}
}

$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
  $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

mysql_select_db($database_reservations, $reservations);
$query_Recordset1 = "SELECT * FROM reservations";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $reservations) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
  $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
  $all_Recordset1 = mysql_query($query_Recordset1);
  $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?><!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>reservationspage</title>
<style type="text/css">
<!--
body {
    background-image: url(images/bg.jpg);
}
-->
</style>
<link href="stayl.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 {
    font-family: "Arial Narrow"
}
-->
</style>
<link href="css/stayl.css" rel="stylesheet" type="text/css" />
<link href="stayl3yabang.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style4 {color: #CCCCCC}
.style5 {font-size: 24px}
-->
</style>
</head>

<body>
<table width="1385" border="1" align="center">
  <tr>
    <th colspan="2" bgcolor="#000000" scope="row">&nbsp;</th>
  </tr>
  <tr>
    <th height="154" colspan="2" bgcolor="#FFFFFF" scope="row"><img src="" alt="" name="LOGO" width="980" height="150" id="LOGO" style="background-color: #FF3300" /></th>
  </tr>
  <tr>
    <th height="10" colspan="2" bgcolor="#FF3300" scope="row">
    <div id="menu">
    <ul class="style2">
    <li><a href="index.html">Home</a></li>
<li><a href="concertspage.html">Concerts</a></li>
<li><a href="sportingevents.html">SportingEvents</a></li>
<li><a href="privateevents.html">PrivateEvents</a></li>
<li><a href="seating.html">Seating</a></li>
<li><a href="rentalspage.html">VenueRental</a></li>
<li><a href="About.html">AboutTheArena</a></li>
</ul>  
    </div>    </th>
  </tr>
  <tr bgcolor="#666666">
    <th width="124" height="299" align="left" valign="top" class="style2" scope="row">
    <label><span class="style5">Options</span></label>
    <table width="124" border="0">
      <tr>
        <th width="118" height="50" class="style4" scope="row">View Reservations</th>
      </tr>
      <tr>
        <th height="50" class="style4" scope="row">Register User Account</th>
      </tr>
    </table>
    <p>&nbsp;</p>
    <p><br />
    </p>    </th>
    <th width="1245" align="center" valign="top" class="style2" scope="row">&nbsp;
      <p>&nbsp;</p>
      
      <table border="1" cellpadding="0" cellspacing="0">
        <tr>
          <td width="121" height="66" align="center" valign="top" nowrap="nowrap" bgcolor="#FF6600">First Name</td>
          <td width="121" align="center" nowrap="nowrap" bgcolor="#FF6500">Last Name</td>
          <td width="144" align="center" valign="bottom" nowrap="nowrap" bgcolor="#FF6500">Contact #</td>
          <td width="140" align="center" valign="middle" nowrap="nowrap" bgcolor="#FF6500">Email Address</td>
          <td width="174" align="center" valign="top" nowrap="nowrap" bgcolor="#FF6500">Company Name</td>
          <td width="140" align="center" valign="middle" nowrap="nowrap" bgcolor="#FF6500">Street Address</td>
          <td width="105" align="center" valign="bottom" nowrap="nowrap" bgcolor="#FF6500">City</td>
          <td width="109" align="center" valign="middle" nowrap="nowrap" bgcolor="#FF6500">Date(s) of Event</td>
          <td width="200" align="center" valign="top" nowrap="nowrap" bgcolor="#FF6500">Brief description of Event</td>
          <td width="200" align="center" valign="top" nowrap="nowrap" bgcolor="#FF6500">&nbsp;</td>
        </tr>
        <?php do { ?>
          <tr>
            <td height="68"><?php echo $row_Recordset1['fname']; ?></td>
            <td><?php echo $row_Recordset1['lname']; ?></td>
            <td><?php echo $row_Recordset1['contactno']; ?></td>
            <td><?php echo $row_Recordset1['emailadd']; ?></td>
            <td><?php echo $row_Recordset1['companyname']; ?></td>
            <td><?php echo $row_Recordset1['streetadd']; ?></td>
            <td><?php echo $row_Recordset1['city']; ?></td>
            <td><?php echo $row_Recordset1['date']; ?></td>
            <td><?php echo $row_Recordset1['description']; ?></td>
            <td><a href="confirmdelete.php?recordID=<?php echo $row_ Recordset1 [' id ']; ?>">delete</a></td>
          </tr>
          <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
      </table></th>
  </tr>
  <tr>
    <th height="23" colspan="2" bgcolor="#000000" scope="row">&nbsp;</th>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

guys pls i need ur expert help :(

Recommended Answers

All 5 Replies

This is the problematic line of code:

<td><a href="confirmdelete.php?recordID=<?php echo $row_ Recordset1 [' id ']; ?>">delete</a></td>

Can you see the error?

<?php echo $row_ Recordset1 ; ?>

You have a space between $row_ and Recordset1

So this is the working code:

<?php require_once('Connections/reservations.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;
    }
    }
     
    $maxRows_Recordset1 = 10;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
    $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    }
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
     
    mysql_select_db($database_reservations, $reservations);
    $query_Recordset1 = "SELECT * FROM reservations";
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $reservations) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
     
    if (isset($_GET['totalRows_Recordset1'])) {
    $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
    $all_Recordset1 = mysql_query($query_Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    }
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
    ?><!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>reservationspage</title>
    <style type="text/css">
    <!--
    body {
    background-image: url(images/bg.jpg);
    }
    -->
    </style>
    <link href="stayl.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    .style2 {
    font-family: "Arial Narrow"
    }
    -->
    </style>
    <link href="css/stayl.css" rel="stylesheet" type="text/css" />
    <link href="stayl3yabang.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    .style4 {color: #CCCCCC}
    .style5 {font-size: 24px}
    -->
    </style>
    </head>
     
    <body>
    <table width="1385" border="1" align="center">
    <tr>
    <th colspan="2" bgcolor="#000000" scope="row">&nbsp;</th>
    </tr>
    <tr>
    <th height="154" colspan="2" bgcolor="#FFFFFF" scope="row"><img src="" alt="" name="LOGO" width="980" height="150" id="LOGO" style="background-color: #FF3300" /></th>
    </tr>
    <tr>
    <th height="10" colspan="2" bgcolor="#FF3300" scope="row">
    <div id="menu">
    <ul class="style2">
    <li><a href="index.html">Home</a></li>
    <li><a href="concertspage.html">Concerts</a></li>
    <li><a href="sportingevents.html">SportingEvents</a></li>
    <li><a href="privateevents.html">PrivateEvents</a></li>
    <li><a href="seating.html">Seating</a></li>
    <li><a href="rentalspage.html">VenueRental</a></li>
    <li><a href="About.html">AboutTheArena</a></li>
    </ul>
    </div> </th>
    </tr>
    <tr bgcolor="#666666">
    <th width="124" height="299" align="left" valign="top" class="style2" scope="row">
    <label><span class="style5">Options</span></label>
    <table width="124" border="0">
    <tr>
    <th width="118" height="50" class="style4" scope="row">View Reservations</th>
    </tr>
    <tr>
    <th height="50" class="style4" scope="row">Register User Account</th>
    </tr>
    </table>
    <p>&nbsp;</p>
    <p><br />
    </p> </th>
    <th width="1245" align="center" valign="top" class="style2" scope="row">&nbsp;
    <p>&nbsp;</p>
     
    <table border="1" cellpadding="0" cellspacing="0">
    <tr>
    <td width="121" height="66" align="center" valign="top" nowrap="nowrap" bgcolor="#FF6600">First Name</td>
    <td width="121" align="center" nowrap="nowrap" bgcolor="#FF6500">Last Name</td>
    <td width="144" align="center" valign="bottom" nowrap="nowrap" bgcolor="#FF6500">Contact #</td>
    <td width="140" align="center" valign="middle" nowrap="nowrap" bgcolor="#FF6500">Email Address</td>
    <td width="174" align="center" valign="top" nowrap="nowrap" bgcolor="#FF6500">Company Name</td>
    <td width="140" align="center" valign="middle" nowrap="nowrap" bgcolor="#FF6500">Street Address</td>
    <td width="105" align="center" valign="bottom" nowrap="nowrap" bgcolor="#FF6500">City</td>
    <td width="109" align="center" valign="middle" nowrap="nowrap" bgcolor="#FF6500">Date(s) of Event</td>
    <td width="200" align="center" valign="top" nowrap="nowrap" bgcolor="#FF6500">Brief description of Event</td>
    <td width="200" align="center" valign="top" nowrap="nowrap" bgcolor="#FF6500">&nbsp;</td>
    </tr>
    <?php do { ?>
    <tr>
    <td height="68"><?php echo $row_Recordset1['fname']; ?></td>
    <td><?php echo $row_Recordset1['lname']; ?></td>
    <td><?php echo $row_Recordset1['contactno']; ?></td>
    <td><?php echo $row_Recordset1['emailadd']; ?></td>
    <td><?php echo $row_Recordset1['companyname']; ?></td>
    <td><?php echo $row_Recordset1['streetadd']; ?></td>
    <td><?php echo $row_Recordset1['city']; ?></td>
    <td><?php echo $row_Recordset1['date']; ?></td>
    <td><?php echo $row_Recordset1['description']; ?></td>
    <td><a href="confirmdelete.php?recordID=<?php echo $row_Recordset1 [' id ']; ?>">delete</a></td>
    </tr>
    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    </table></th>
    </tr>
    <tr>
    <th height="23" colspan="2" bgcolor="#000000" scope="row">&nbsp;</th>
    </tr>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>

Kieran :)

OMG.. I think it worked.. :D thank you so much dude.. do you mind if I pm u for some other questions.. pls? :)

Member Avatar for P0lT10n

Mark this as solved please... and dont let a space between because may cause a problem... and together with $row_Recordset1

I will always try and help ;)

Kieran :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.