首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >函数名必须是字符串。无法使用行显示数据库中的数据

问函数名必须是字符串。无法使用行显示数据库中的数据
EN

Stack Overflow用户
提问于 2013-12-08 23:53:44
回答 1查看 196关注 0票数 1

这是我的事件编码。我希望它在我的系统中显示事件属性。错误显示是

致命错误:函数名必须是D:\XAMPP\htdocs\system\bulletin.php中的字符串

函数名必须是字符串,这意味着什么?错误在哪里?我该换哪条线?

代码语言:javascript
复制
<th scope="col"><center><strong>Event ID</strong></center></th>
<th scope="col"><center><strong>Event</strong></center></th>
<th scope="col"><center><strong>Description of the Event</strong></center></th>

<?php
require 'database.php';

$qry = "SELECT * FROM bulletin ORDER BY event_id DESC";
$result = mysql_query($qry) OR die (mysql_error());

while($row = mysql_fetch_assoc($result())){
$event_id = $row['event_id'];
$event = $row['event'];
$venue = $row['venue'];
$daydropdown_start = $row['day1'];
$monthdropdown_start = $row['month1'];
$yeardropdown_start = $row['year1'];
}


<td><? echo $row['event_id']; ?></td>
<td><? echo $row['event']; ?></td>
<td><br>Venue:<?php echo $row['venue']; ?></br>
<br>  Date: <?php echo $row['day1'] / $row['month1'] / $row['year1']; ?> </br></td>
EN

回答 1

Stack Overflow用户

发布于 2013-12-08 23:56:40

我猜你的错误在这行while($row = mysql_fetch_assoc($result())){里

$result不是一个函数,而是一个变量。把它改成

while($row = mysql_fetch_assoc($result)){,你应该做得很好

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20460820

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档