Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

AliceWonderFull on "Prepared Statements"

$
0
0

http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/

Says prepared statements require two arguments.

I don't understand something, it looks like it requires you to pass the argument at the time you prepare the statement?

in PDO you do something like

$sql = 'DELETE FROM ' . $this->sqltable . ' WHERE tid=?';
$q = $this->pdo->prepare($sql);

Then later you can use it by calling

$q->execute($arg)

You can't do that with WordPred $wpdb prepared statements? You have to know the argument(s) at the time you prepare it?

That seems wrong, what am I missing?


Viewing all articles
Browse latest Browse all 8245

Trending Articles