Note that there are some explanatory texts on larger screens.

plurals
  1. POPDO: Update does not work, no error
    primarykey
    data
    text
    <p>time for a little mystery: I got this Query:</p> <pre><code>$stmt = 'update wp_term_relationships set term_taxonomy_id = :newID '. 'where term_taxonomy_id= :oldID and object_id = :postID'; self::$stmtSetNewID = self::$dataBase-&gt;prepareStatement($stmt); [...] self::$stmtSetNewID-&gt;bindParam(':oldID', $oldCatID, PDO::PARAM_INT); self::$stmtSetNewID-&gt;bindParam(':newID', $newCatID, PDO::PARAM_INT); self::$stmtSetNewID-&gt;bindParam(':postID', $postID, PDO::PARAM_INT); $result = self::$stmtSetNewID-&gt;execute(); $rowCount = self::$stmtSetNewID-&gt;rowCount(); echo $rowCount; </code></pre> <p>I tried setting the error level</p> <pre><code>$this-&gt;pdo-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); </code></pre> <p>and output a possible error</p> <pre><code>var_dump(self::$stmtSetNewID-&gt;errorInfo()); </code></pre> <p>and output the count of the affected rows (at the end of the code above). No error, no warning, nothing. <code>rowCount()</code> returns 1, but the values in the database keep unchanged.</p> <p>For me, it looks like the PDO / Database is saying everything worked, but it <strong>didnt</strong>!</p> <p>I am frustrated as hell and would appreciate every hint! Thank you!</p> <p>UPDATE:</p> <pre><code>echo "\nPostID: $postID | oldID: $oldCatID ". "| newID: $newCatID | rowCount: $rowCount\n&lt;br/&gt;\n"; </code></pre> <p>the outputed values are correct, <code>$rowCount</code> is 1:</p> <pre><code>PostID: 5432 | oldID: 3 | newID: 32 | rowCount: 1 PostID: 5435 | oldID: 3 | newID: 8 | rowCount: 1 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload