你好我真的在努力解决这个问题
我有一个脚本可以将阿拉伯字母插入数据库
我的数据库和表是 utf-unicode_ci
$title = make_safe($_POST['title']);
$author = make_safe($_POST['author']);
$category = make_safe($_POST['category']);
$meta = str_replace(array('-', ' ', '*'),",",make_safe($_POST['meta']));
if ($title == "" OR $author == "" OR $category == "")
{
echo $lang['STORY_FIELDS_MUST_FILL'];
echo "<META HTTP-EQUIV='refresh' CONTENT='2; URL= stories.php?action=add'>";
}
else
{
$stmt = $db->prepare ("INSERT INTO stories (title,author,category,meta,date)
VALUES (:title,:author,:category,:meta)");
$stmt->execute(array(':title' => $title,
':author' => $author,
':category' => $category,
':meta' => $meta));
echo "$lang[STORY_ADDED]";
echo "<META HTTP-EQUIV='refresh' CONTENT='2; URL=" . $_SERVER['HTTP_REFERER'] . "'>";
}
从这个php代码添加文章时,它在phpmyadmin中显示如下
当我通过 Phpmyadmin 插入值时
它像这样显示,一切都很好
我如何通过 php 代码添加它以显示与从 phpmyadmin 添加它一样