Problem with update_col updating only unchecked records

MILORD65

Member
I'm having a problem with the update_col plugin.
I configured it to update an "official" field with an eval expression that will look for a value in another "t_reattribution_folders" table:

$db = Jfactory::getDbo();
$query = $db->getQuery(true);
$query = "UPDATE t_registre_dossiers SET t_registre_dossiers.fonctionnaire = (SELECT t_reattribution_dossiers.fonctionnaire FROM t_reattribution_dossiers WHERE t_reattribution_dossiers.id = 1)";
$db->setQuery($query);
$db->execute();


it works very well but it only updates records that are not checked while I want it to update those I checked!
Does anyone have the same problem?
Which solution ?
 
That query won't do anything to do with selected rows. It's not even valid SQL, unless the subquery only returns one row. And it's going to update every row in the first table.

-- hugh
 
Hello,

Thank you for your answers.
Actually the subquery returns a single line, that's what is wanted.
However, it is true that it is a bit written with the feet, but I don't know how to make so that the value of the checked line is replaced by the value of the subquery.
An advice ?

JPB
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top