函数名必须是字符串。不能使用行显示来自数据库的数据

时间:2022-09-25 21:41:15

This is my event coding. I want it to display the Event Properties in my system. The error display is

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

Fatal error: Function name must be a string in D:\XAMPP\htdocs\system\bulletin.php

致命错误:函数名必须是D:\XAMPP\htdocs系统\项目符号.php中的字符串

What does it means by function name must be a string ? Where is the error ? Which line should I change ?

函数名意味着什么?误差在哪里?我应该换乘哪条线?

<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>

1 个解决方案

#1


2  

I'm guessing your error is in this line while($row = mysql_fetch_assoc($result())){

我猜您的错误在这一行($row = mysql_fetch_assoc($result()))){

$result isn't a function, but a variable. Change it to

$result不是一个函数,而是一个变量。将其更改为

while($row = mysql_fetch_assoc($result)){, and you should be good

while($row = mysql_fetch_assoc($result)),您应该很好。

#1


2  

I'm guessing your error is in this line while($row = mysql_fetch_assoc($result())){

我猜您的错误在这一行($row = mysql_fetch_assoc($result()))){

$result isn't a function, but a variable. Change it to

$result不是一个函数,而是一个变量。将其更改为

while($row = mysql_fetch_assoc($result)){, and you should be good

while($row = mysql_fetch_assoc($result)),您应该很好。