l need to generate a dynamic PDO update query.
l am not sure of the behaviour where we have the same placeholder name in th update and WHERE clause for example

UPDATE users SET name = 'Master User' WHERE name = 'Dev User'

As you can see placeholder name will occur twice in the query so when l bind the values what happens

Member Avatar for diafol
$st = $db->prepare("UPDATE users SET name = :newval WHERE name = :oldval");
$st->execute(array(":newval"=>$newval,":oldval"=>$oldval));
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.