Parse Error using wamp

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
blindstone
Forum Newbie
Posts: 1
Joined: Thu May 07, 2009 8:57 am

Parse Error using wamp

Post by blindstone »

Alright bit of background on this,
Created a script and uploaded it to my website, works fine no issues
Running the same mySQL server and version of PHP i am now getting a parse error on the close bracket (" } ") on some of my pages when its hosted using the wamp server. Here is the code

Code: Select all

 
<?php
// Connects to your Database 
include("sql.php");
$mode = $_GET['mode'];
if ( $mode=="Remove") 
{
$removeID = $_GET['rma'];
$sql = "DELETE FROM rma WHERE rma = ".$removeID."";
$remove = mysql_query($sql);
$_SERVER['REQUEST_URI'];
}
if ( $mode=="Complete") 
{
$CompleteID = $_GET['rma'];
$update = 'UPDATE rma SET Status = \'Complete\' WHERE rma = \''.$CompleteID.'\' LIMIT 1'; 
$Complete = mysql_query($update);
$_SERVER['REQUEST_URI'];
}
$Text = $_GET['Text'];
$search = $_GET['searchBy'];
$sql = 'SELECT * FROM `rma` WHERE `'.$search.'` LIKE \'%'.$Text.'%\' LIMIT 0, 30 ';  
 
$guests = mysql_query($sql) or die(mysql_error());
?>
<?
while ($guest = mysql_fetch_array($guests)) {
?>
 
<table width="700" height="24" border="1" cellpadding="1" cellspacing="0">
  <tr>
    <th width="29" height="22" align="center" scope="col"> <span class="style5">
      <?php
              echo $guest['rma'];
              ?>
      </span></th>
    <th width="155" align="center" scope="col"><div align="left" class="style5">
      <?php
              echo $guest['Name'];
              ?></div></th>
    <th width="115" align="center" scope="col"><div align="left" class="style5">
    <?php
              echo $guest['Phone'];
              ?></div></th>
    <th width="93" align="left" scope="col"><span class="style5">
      <?php
              echo $guest['Status'];
              ?>
    </span></th>
    <th width="143" align="left" scope="col"><span class="style5">
      <?php
              echo $guest['manRMA'];
              ?>
    </span></th>
    <th width="24" align="left" scope="col"><span class="style5"><a href="?id=editRMA.php&rma=<?php echo $guest['rma']; ?>">Edit</a></span></th>
    <th width="58" align="center" scope="col"><span class="style5"><a href="?id=search2.php&mode=Complete&rma=<?php echo $guest['rma']; ?>&Text=<?php echo $Text ?>&searchBy=<?php echo $search ?>">Complete</a></span></th>
    <th width="49" align="center" scope="col"><span class="style5"><a href="?id=search2.php&mode=Remove&rma=<?php echo $guest['rma']; ?>&Text=<?php echo $Text ?>&searchBy=<?php echo $search ?>">Remove</a></span></th>
  </tr>
</table>
<?php 
} ?>
Any ideas? Thanks!
Last edited by Benjamin on Thu May 07, 2009 11:40 am, edited 1 time in total.
Reason: Changed code type from text to php.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Parse Error using wamp

Post by jaoudestudios »

'UPDATE rma SET Status = 'Complete' WHERE rma = ''.$CompleteID.'' LIMIT 1'
Your quotes are wrong. If you want to use the same type of quote you need to escape them, otherwise mix the quotes.
Post Reply