Unexpected $end in php script?
<p>I have this bit of code that looks fine to me, but I keep getting the following error: </p>

<blockquote>
  <p>"Parse error: syntax error, unexpected $end in
  /home/txclanco/public_html/hotmuze/addSong.php on line 21"</p>
</blockquote>

<p>This is a script that takes in the input from a form, checks for duplicates and if there is a duplicate, it will not make a new row but just add 1 to the 'rating' row where the songname is the song typed in. If there isn't a duplicate, the script will add the data as a new row. The data types are:</p>

<ul>
<li>id = A_I/int</li>
<li>songname = varchar</li>
<li>artist = varchar</li>
<li>rating = int</li>
</ul>

<p><strong>The script is below with the mysql data blanked out:</strong></p>

<pre><code>&lt;?
  mysql_connect("localhost", "***", "***") or die(mysql_error());
  mysql_select_db("***") or die(mysql_error());
  $songname = $_POST['songname'];
  $artist = $_POST['by'];
  $ratenum = 1; 
  $chkquery = "SELECT * FROM hotmuze WHERE songname='$songname'";
  $plusOneQuery = "SELECT * FROM hotmuze WHERE songname='$songname'";
  $updateQuery = "UPDATE hotmuze SET rating='$rating2' WHERE songname='$songname'";
  $checkdata = mysql_query($chkquery);
  $checkrows = mysql_num_rows($checkdata); 

  if($checkrows==0) 
  {
      $insquery = "INSERT INTO hotmuze (id, songname, artist, rating) VALUES('', '$songname', '$artist', '$ratenum'";
      $insdata = mysql_query($insquery); 
  }

  if($checkrows!=0) 
  { 
    $plusData = mysql_query($plusOneQuery);
  }

  if(mysql_num_rows($plusData)!=0) 
  {
    $result = mysql_fetch_assoc($plusData);
    $rating = $result['ratng'];
    $rating2 = $rating + 1;
    mysql_query($updateQuery); 
    echo "Data Inserted";
  } 
?&gt;
</code></pre>

<p>Line 21 being:</p>

<pre><code>if($checkrows!=0) 
{
  // The brace is on line 21
  $plusData = mysql_query($plusOneQuery);
}
</code></pre>

<p>Any ideas what could be wrong with the script? I know the Unexpected $end error usually means that there's a brace out of place, but this time, it's fine?</p>
