-3
次のコードで何が問題になっていますか?スマイリー機能がなければ、それは働きます。$ tz = smiley($ this-> text);はありません。行を挿入できません
私はあなたが適切な関数を呼び出す配置することによって、エラー報告を有効にしている... PHPコードの外.. mhmmが動作しないエラーが、...を表示するために入れて0エラー
ini_set('display_errors',1);
error_reporting(E_ALL);
<?php
class ChatLine extends ChatBase
{
protected $text = '', $author = '', $gravatar = '';
public function save()
{
$tz = smiley($this->text);
DB::query("
INSERT INTO webchat_lines (author, gravatar, text)
VALUES (
'".DB::esc($this->author)."',
'".DB::esc($this->gravatar)."',
'".$tz."'
)");
// Returns the MySQLi object of the DB class
return DB::getMySQLiObject();
}
public function smiley($text)
{
$privatesmilies = array(
":)" => "smile1.gif",
";)" => "wink.gif"
);
reset($privatesmilies);
while (list($code, $url) = each($privatesmilies))
$text = str_replace($code, "<img src=http://127.0.0.1/chat/img/$url align=absmiddle/>", $text);
return $text;
}
}
?>
$ tz = $ this-> smiley($ this-> text);を試してください。 – ajacian81
ありがとうございました!!! :) –
このリンゴは何が問題なのですか? _Please_ **なぜそれが機能しないのかについていくつかの説明をしてください。 – Bojangles