note 111504 rejected from pdo.prepare by danbrown
| From: | danbrown@php.net | Date: | Mon, 04 Mar 2013 17:49:11 +0000 |
| Subject: | note 111504 rejected from pdo.prepare by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193826@lists.php.net to get a copy of this message | ||
Note Submitter: sanek7 dot 7 at mail dot ru
----
<?php
$last_id = DB::connect()->lastInsertId();
$arr = array(
"users_war",
"users_skills",
"users_setting",
"users_equip",
"users_ban" );
$query = DB::connect()->prepare( "INSERT INTO
? (id) VALUES
(?);" );
foreach ( $arr as $ar )
{
$query->bindParam(1, $ar, PDO::PARAM_STR);
$query->bindParam(2, $last_id, PDO::PARAM_INT);
$query->execute();
}
?>
Why not work?
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base
table or view not found: 1146 Table 'vs.'users_war'' doesn't exist'
why 'vs.'users_war'' and not 'vs.users_war'?