在这里需要一些帮助 - 我有一个向用户显示数据的表格:用户可以选择更新表格。如果表格已更新,我想用随附的(更新的)数据生成一封电子邮件。目前清除?邮件功能 - 致命错误:函数名称必须是字符串
当我运行它更新的数据库,但发送以下错误代码 -
Fatal error: Function name must be a string in C:\xampp\htdocs\mlac\mlac_member2.php on line 226
确定 - 这里是培训相关的代码(我已经离开了休息,因为它增加了没有这个问题):
<?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)){
?>
HTML
<caption>Personal Record</caption>
<tr>
<th>ID</th>
<td><?php
echo $row['id'];
?></td>
</tr>
<tr>
<th>Name</th>
<td><?php
echo $row['name'];
?></td>
</tr>
<tr>
<th>E-Mail</th>
<td><?php
echo $row['email'];
?></td>
</tr>
<tr>
<th>Main Telephone</th>
<td><?php
echo $row['maintel'];
?></td>
</tr>
<tr>
<th>Mobile Telephone</th>
<td><?php
echo $row['mobtel'];
?></td>
</tr>
<tr>
<th>Organisation</th>
<td><?php
echo $row['organisation'];
?></td>
</tr>
<tr>
<th>Group Leader</th>
<td><?php
echo $row['group_leader'];
?></td>
</tr>
<tr>
<th>Supervisor</th>
<td><?php
echo $row['supervisor'];
?></td>
</tr>
<tr>
<th>Volunteer</th>
<td><?php
echo $row['volunteer'];
?></td>
</tr>
<tr>
<th>Assessor</th>
<td><?php
echo $row['assessor'];
}
}
?></td>
</tr>
</table>
<br />
<form method="post" action="update.php">
<input name="Submit1" type="submit" value="Edit" style="width: 67px" /></form>
<p> </p>
[/ HTML]
<?php
$to='[email protected]';
$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);
?>
如果sanyone可以帮助我将不胜感激。
问候,
试试这个$名称= $行[ '名称'];也可用于其他行元素 – 2012-04-21 09:56:23
下次请指出哪一个是'226行'。 – kapa 2012-04-21 09:57:01