本文介绍了PDO:获取结果时带斜线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是PDO准备好的语句,因此在插入数据库之前需要时会添加斜杠.
I am using PDO prepared statements so it's adding slashes when it's needed before inserting into the database.
我想知道获取结果并将其显示在网站上而不显示斜线的正确方法.
I was wondering the proper way to get the results and display it on the website without showing the slashes.
像使用echo stripslashes($result->message);
一样简单吗?
这是我的查询内容:
$database->query('INSERT INTO table_name (field1, field2, field3) VALUES (?, ?, ?)', array($value1, $value2, $value3));
这是我的query
方法:
public function query($query, $bind=null)
{
global $pdo;
# Prepare Statment
$this->statement = $this->pdo->prepare($query);
# Execute Query
$this->statement->execute($bind);
}
get_magic_quotes_gpc
确实已打开,即使WHM(cPanel)表示已关闭
get_magic_quotes_gpc
was indeed turned on even though WHM (cPanel) said it was off
推荐答案
get_magic_quotes_gpc
确实已打开,即使WHM(cPanel)表示已关闭
get_magic_quotes_gpc
was indeed turned on even though WHM (cPanel) said it was off
这篇关于PDO:获取结果时带斜线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!