致命错误:函数名称必须是第6行的C:\ xampp \ htdocs \ ambot \ database.php中的字符串

时间:2013-03-10 06:41:49

标签: stored-procedures php

我有PHP代码从数据库调用存储过程。

<?php
include("DataBase.php");
$sql=$mysqli_query("CALL sp()");
if( $sql === FALSE ) {
trigger_error('Query failed returning error: '. $mysqli_error(),E_USER_ERROR);
} else {
while($row=$mysqli_fetch_array($sql))
{
echo $row['id'].'--'.$row['item'].'';
}
}
?>

DB Conection;

<?php
$mysqli_hostname = "localhost";
$mysqli_user = "root";
$mysqli_password = "";
$mysqli_database = "liveedit";
$bd = $mysqli_connect($mysqli_hostname, $mysqli_user, $mysqli_password) 
or die("Opps some thing went wrong");
$mysqli_select_db($mysqli_database, $bd) or die("Opps some thing went wrong");
?>

代码返回此错误:

Fatal error: Function name must be a string in C:\xampp\htdocs\ambot\database.php on line 6

代码有什么问题?我尝试修复此问题,但在我的代码中使用存储过程修复此问题会增加难度。

0 个答案:

没有答案