I dont want '1' to be included next to string
<p>I have this code below:
    $insert = array();</p>

<pre><code>  for ($i = 1, $n = $_POST['sessionNum']; $i &lt;= $n; ++$i)
  {

      if( $_POST['sessionNum'] == '1'){
            $insert[] = "'" . mysql_real_escape_string($_POST['id']) . ($i == 1 ? '' : $i) . "'";
        }else{
            $insert[] = "'" . mysql_real_escape_string($_POST['id']) . "'";
        }


    $insert[] .= "' ". mysql_real_escape_string( $_POST['textMarks'] ) . "'";
  }

  $sql = "INSERT INTO Session (SessionId, TotalMarks) 
  VALUES (" . implode('), (', $insert) . ")";


  mysql_query($sql);
</code></pre>

<p>What the code above does is that it adds a number next to the $_POST['id'] depending on what the number is in the $_POST['sessionNum'].</p>

<p>For example if  $_POST['sessionNum'] is '3'  and  $_POST['id'] is VBV, then it will display 'VBV3'. </p>

<p>But what I want is that if $_POST['sessionNum'] is '1', I do not want it to display 'VBV1' but instead just 'VBV' as it is a single session. </p>

<p>How can this be achieved?</p>
