1 users online. Create an account or sign in to join them.Users
Querying to update entries_data
This is an open discussion with 2 replies, filed under Troubleshooting.
Search
Try
Symphony::Database()->query("
UPDATE `sym_entries_data_".$updated."`
SET `value`='no'
");
The grave accent tells MySQL that you want the value column to contain the value of the no column, instead of having the string value of 'no'
Thanks Remie, thought I'd replied to this already. Sorry for the delay was being a noob.
Create an account or sign in to comment.
Attempting to update all entries of a field-type named 'updated' on a section which is selected in the XML importer module.
As all entries need resetting to 'no' before the entries are parsed from XML feed to the DB I thought a simple MySQL would be efficient after finding the correct section and field ID.
$sectionManager = new SectionManager(Symphony::Engine()); $section = $sectionManager->fetch($options['section']); // Mark the updated field if ($options['mark-updated'] == 'yes'){ $fields = $section->fetchFields('updated'); foreach($fields as $field){ //var_dump($updated); $updated = $field->get("id"); Symphony::Database()->query(" UPDATE `sym_entries_data_".$updated."` SET `value`=`no` "); } }But it makes me sad as it doesn't want to work...
An error occurred while attempting to execute the following query
Thanks for any responses.