Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Use SQL REPLACE function in UPDATE SET
Use SQL REPLACE function in UPDATE SET [message #2917] Sat, 17 March 2012 02:31 Go to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Wonder how to build and execute a SQL statement like this within the Radicore framework:

UPDATE msg SET author=REPLACE(author,'_',' ') WHERE id>100

Tried using updateSelection($where, $replace),
with $replace = "author='REPLACE(author,'_',' ')'".

However, that will result in the author column being populated with 'REPLACE'.

If this cannot be done within the current framework, we can iterate through each row and update each row separately, or is there a simpler / more efficient way?
Re: Use SQL REPLACE function in UPDATE SET [message #2918 is a reply to message #2917] Sat, 17 March 2012 04:13 Go to previous message
AJM is currently offline  AJM
Messages: 2277
Registered: April 2006
Location: Surrey, UK
Senior Member
Inside the 'updateSelection()' method within 'std.table.class.inc' at line 5403 there is a spurious trim() statement - remove it and your problem disappears.

Previous Topic: Field Alignment and formatting
Next Topic: Email attachments
Goto Forum:
  


Current Time: Tue Jan 18 02:16:36 EST 2022

Total time taken to generate the page: 0.01089 seconds