さて、私のアプリでは、mysqlでphpのpdoを使用します。これは、データベースにあります。
"Tiny & Big: Grandpa's Leftovers" - 75% off
何らかの理由で引用符が含まれていると、編集用のフォームフィールドにエコーアウトできなくなります。引用符がないエントリでは、正常に機能します。
これでクエリ出力を確認しましたが、明らかにオプションが表示されます。
[info] => "Tiny & Big: Grandpa's Leftovers" - 75% off
それで、なぜそれが使えないのか迷っていますか?
この小さな関数を使用してデータをフェッチします。
public function fetch()
{
$this->STH->setFetchMode(PDO::FETCH_ASSOC);
return $this->STH->fetch();
}
そして実際のクエリ関数:
// the main sql query function
public function sqlquery($sql, $objects = array())
{
global $core;
try
{
$this->STH = $this->database->prepare($sql);
foreach($objects as $k=>$p)
{
// +1 is needed as arrays start at 0 where as ? placeholders start at 1 in PDO
if(is_numeric($p))
{
$this->STH->bindValue($k+1, (int)$p, PDO::PARAM_INT);
}
else
{
$this->STH->bindValue($k+1, $p, PDO::PARAM_STR);
}
}
return $this->STH->execute();
}
catch (Exception $e)
{
$core->message($e->getMessage());
}
$this->counter++;
$this->queries .= "<br />$sql";
}