07/01/12 15:41:32
MDB2(MySQL)についてなんですが
DBパッケージでいうプレイスホルダ的な事はできないんですかね?
このように(↓)書いてみたのですが、
$sql="INSERT INTO `user` (user_account, user_password, user_mail) VALUES (?,!,?)";
$affected =& $mdb2->exec($sql, array('$tmp_account', '$tmp_pass', '$tmp_mail'));
if(MDB2::isError($affected)) die('失敗:'.$affected->getDebugInfo());
(※元ソースは長いので要素の数とかを適当に省きました)
こんな(↓)エラーメッセージが返ってきてしまいますorz
Error message: Could not execute statement
Native message: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version
for the right syntax to use near '?,!,?)' at line 1
syntaxがどうのこうのって書いてあるので、このやり方はダメないのかなと・・・
ちなみにプレイスホルダ使わないで書いた方では正常に動作してます。
よろしくお願いします。