I am still new to PDO and am having trouble getting the update statement below to work. I want to be able to update the name field by just appending to the current value with a comma and the new name. Resulting name field should be like james,doug,paul,etc. This is probably a simple answer but I haven’t been able to find a solution through a lot of googling!
Thanks in advance
$stmt = $db->prepare('UPDATE table SET name = concat(name, ',' :name) WHERE id = :id');
$stmt->execute( array('name' => $name, 'id' => $id) );
you lack comma inside your concat.