我收到此文本的错误:(对不起,我的英语不好,我来自德国!)
I get an error with this text:(sorry for my bad english I am from germany!)
错误:致命错误:在第 44 行的/users/ftf/www/ccache.php 中的非对象上调用成员函数 bind_param()
来自 ccache.php 的部分代码
A part of the Code from ccache.php
// Neues Datenbank-Objekt erzeugen
$db = @new mysqli( 'localhost', 'ftf', '***', 'ftf' );
// Pruefen ob die Datenbankverbindung hergestellt werden konnte
if (mysqli_connect_errno() == 0)
{
$sql = "INSERT INTO cache
('name', 'user', 'veroefentlichung', 'beschreibung', 'FTFcode', 'STFcode', 'TTFcode', 'type', 'lat', 'lon', 'address', 'link')
VALUES ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?')";
$eintrag = $db->stmt_init();
$eintrag = $db->prepare( $sql );
$eintrag->bind_param($titel, $user, $datum, $desc, $FTF, $STF, $TTF, $type, $Lat, $Lon, $shortdesc, $genlink); // line 44
$eintrag->execute();
// Pruefen ob der Eintrag efolgreich war
if ($eintrag->affected_rows == 1)
{
echo 'Der neue Eintrage wurde hinzugefügt.';
}
else
{
echo 'Der Eintrag konnte nicht hinzugefügt werden.';
}
}
$eintrag->bind_param($titel, $user, $datum, $desc, $FTF, $STF, $TTF, $type, $Lat, $Lon, $shortdesc, $genlink); // line 44
你需要这样定义参数的类型:
You need to the define the type of parameters as this:
$eintrag->bind_param("ssssssiiss", $titel, $user, $datum, $desc, $FTF, $STF, $TTF, $type, $Lat, $Lon, $shortdesc, $genlink); // line 44
s - 字符串我 - 整数还要检查文档:http://php.net/manual/en/mysqli-stmt.bind-param.php
s - string i - int Also check documentation: http://php.net/manual/en/mysqli-stmt.bind-param.php
这篇关于(致命错误:在非对象上调用成员函数 bind_param())的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
mysql 中的 store_result() 和 get_result() 返回 falsestore_result() and get_result() in mysql returns false(mysql 中的 store_result() 和 get_result() 返回 false)
调用未定义的函数 mysqli_result::num_rows()Call to undefined function mysqli_result::num_rows()(调用未定义的函数 mysqli_result::num_rows())
PHP 准备好的语句问题PHP Prepared Statement Problems(PHP 准备好的语句问题)
mysqli_fetch_array 只返回一个结果mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一个结果)
PHP MySQLi 多次插入PHP MySQLi Multiple Inserts(PHP MySQLi 多次插入)
如何确保 MySQL 中的值在 PHP 中保持其类型?How do I make sure that values from MySQL keep their type in PHP?(如何确保 MySQL 中的值在 PHP 中保持其类型?)