You do not use fetchAll(),as in
$result = $stmt->fetchAll();
with update or insert queries. Removing this statement should rectify the problem.
More Related Contents:
- Insert form in MySQL with PDO [duplicate]
- Undefined index $_POST
- How to check if a row exists in MySQL? (i.e. check if username or email exists in MySQL)
- Are PDO prepared statements sufficient to prevent SQL injection?
- Reference — frequently asked questions about PDO
- Getting raw SQL query string from PDO prepared statements
- How do I set ORDER BY params using prepared PDO statement?
- “Invalid parameter number: parameter was not defined” Inserting data
- Having issue with matching rows in the database using PDO
- How can I properly use a PDO object for a parameterized SELECT query
- How do I return integer and numeric columns from MySQL as integers and numerics in PHP?
- pdo – Call to a member function prepare() on a non-object [duplicate]
- PDO with INSERT INTO through prepared statements [closed]
- How to replace MySQL functions with PDO?
- Connect to SQL Server through PDO using SQL Server Driver
- Real escape string and PDO [duplicate]
- How to check if a row exist in the database using PDO?
- PHP PDO vs normal mysql_connect
- Can I create a database using PDO in PHP?
- PHP PDO::bindParam() data types.. how does it work?
- PDO::PARAM for type decimal?
- PHP PDO and MySQLi [duplicate]
- PDO fetch one column from table into 1-dimensional array
- Using value of a column as index in results using PDO
- Retrieve (or simulate) full query from PDO prepared statement
- Getting a PHP PDO connection from a mysql_connect()?
- PDO returning incorrect, but duplicate, data. Key’s not in database.
- Having issue with matching rows in the database
- Set PDO to throw exceptions by default [duplicate]
- PDO and MySQL ‘between’