$sql="UPDATE user_alerts SET notif = notif + 2 WHERE ( user_id = :userid )";
$prepStatement = $pdo->prepare( $sql );
$prepStatement->execute(array(':userid' => $userid));
You can’t bind a column name to a prepared statement.
More Related Contents:
- Insert form in MySQL with PDO [duplicate]
- Undefined index $_POST
- Can I mix MySQL APIs in PHP?
- How to check if a row exists in MySQL? (i.e. check if username or email exists in MySQL)
- 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 with INSERT INTO through prepared statements [closed]
- PDO::fetchAll vs. PDO::fetch in a loop
- PHP Connection failed: SQLSTATE[HY000] [2002] Connection refused
- Real escape string and PDO [duplicate]
- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax — PHP — PDO [duplicate]
- PDO Connection Test
- PHP PDO vs normal mysql_connect
- Can I create a database using PDO in PHP?
- PHP PDO and MySQLi [duplicate]
- PDO fetch one column from table into 1-dimensional array
- Getting a PHP PDO connection from a mysql_connect()?
- PDO error: SQLSTATE[HY000]: General error: 2031
- Having issue with matching rows in the database
- Use of PDO in classes [duplicate]
- Check if row exists in the database before inserting
- PHP/PDO/MySQL: inserting into MEDIUMBLOB stores bad data
- How to escape single-quote (apostrophe) in string using php
- php, mysql – Too many connections to database error
- Insert value list does not match column list: 1136 Column count doesn’t match value count
- PDO and MySQL ‘between’