title: Mail Function - Fatal error: Function name must be a string
body: <p>Need some help here - I have a table which presents a User with data: the User has the option to update the table. If the table is updated I want to generate an email with that (updated) data enclosed. Clear so far?</p>
  
  <p>When I run the code it does update the database but sends the following error -</p>
  
  <pre><code>Fatal error: Function name must be a string in C:\xampp\htdocs\mlac\mlac_member2.php on line 226
  </code></pre>
  
  <p>OK - here is the relevent code (I have left out the rest because it adds nothing to this problem):</p>
  
  <pre><code>&lt;?php
  
  if (isset($_GET['view']))
      {
      $user = sanitizeString($_GET['view']);
  
  
  
  
      $data = "SELECT * FROM names WHERE id='$user'";
      $result=mysql_query($data) or die(mysql_error());
  
      while($row=mysql_fetch_array($result)){
  
  ?&gt;
  </code></pre>
  
  <p>html
      <br />
          <br />
      </p>
  
  <pre><code>    &lt;caption&gt;Personal Record&lt;/caption&gt;
  
  &lt;tr&gt;
  &lt;th&gt;ID&lt;/th&gt;
      &lt;td&gt;&lt;?php
          echo $row['id'];
       ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;th&gt;Name&lt;/th&gt;
      &lt;td&gt;&lt;?php
          echo $row['name'];
       ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;th&gt;E-Mail&lt;/th&gt;
      &lt;td&gt;&lt;?php
          echo $row['email'];
       ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;th&gt;Main Telephone&lt;/th&gt;
      &lt;td&gt;&lt;?php
          echo $row['maintel'];
       ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;th&gt;Mobile Telephone&lt;/th&gt;
      &lt;td&gt;&lt;?php
          echo $row['mobtel'];
       ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;th&gt;Organisation&lt;/th&gt;
      &lt;td&gt;&lt;?php
          echo $row['organisation'];
       ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;th&gt;Group Leader&lt;/th&gt;
      &lt;td&gt;&lt;?php
          echo $row['group_leader'];
       ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;th&gt;Supervisor&lt;/th&gt;
      &lt;td&gt;&lt;?php
          echo $row['supervisor'];
       ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;th&gt;Volunteer&lt;/th&gt;
      &lt;td&gt;&lt;?php
          echo $row['volunteer'];
       ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;th&gt;Assessor&lt;/th&gt;
      &lt;td&gt;&lt;?php
          echo $row['assessor'];
  
          }
          }
       ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;/table&gt;
  
  
      &lt;br /&gt;
      &lt;form method="post" action="update.php"&gt;
          &lt;input name="Submit1" type="submit" value="Edit" style="width: 67px" /&gt;&lt;/form&gt;
  
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  </code></pre>
  
  <p>[/html]</p>
  
  <pre><code>&lt;?php   
  
  $to='xy@sth.com';
  $subject='Test Script';
  
  $name=$row('name');
  $email=$row('email');
  $phone=$row('mobtel');
  $message=("Name:  ").$name. ("\r\n") . ("Email:  ") .$email . ("\r\n") . ("Phone:  ")    .$phone;
  
  
  mail($to,$subject,$message);
  
  ?&gt;
  </code></pre>
  
  <p>If sanyone can help I would be grateful.</p>
  
  <p>Regards,</p>