bindParam works with values, but does not work with names, how to fix it?
$cache = XXXX->prepare('ALTER TABLE XXX ADD :name varchar(2) NOT NULL;'); $cache->bindParam(':name', $name, PDO::PARAM_STR); $cache->execute(); bindParam works with values, but does not work with names, how to fix it?
$cache = XXXX->prepare('ALTER TABLE XXX ADD :name varchar(2) NOT NULL;'); $cache->bindParam(':name', $name, PDO::PARAM_STR); $cache->execute(); Database ABC:
The database structure changes only when the site is updated, and never on the fly.
If you suddenly need to add fields to the table from user input - this means that the database is not designed correctly
Source: https://ru.stackoverflow.com/questions/509426/
All Articles