Change blank space for 0 on BD [SOLVED]

More
10 years 5 months ago - 10 years 5 months ago #52051 by tevez15
Hello,

My problem is not directly connected with flexicontent. I have some fields in flexi with a html tables, and in that tables I have values (1 >).
My client dont using the value 0, using space in that case, and now I need to this field, change all spaces for 0, and I try using it:
Code:
UPDATE jos_flexicontent_fields_item_relations SET value = REPLACE ( value , '%> </td>%' , '%>0</td>%' ) WHERE field_id=25 AND item_id=977;

For same reason, I cant change the ' ' and I dont know why, but if I use this, BD returns me a value:
Code:
SELECT value, item_id FROM jos_flexicontent_fields_item_relations WHERE value LIKE '%> </td>%' AND field_id=25 AND item_id=977

If someone know how do this, please help :P I'm a noobie in BD thank you.
Last edit: 10 years 5 months ago by tevez15.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #52052 by ggppdk
Hello

wildcard character is meant to be used in the
LIKE mysql clause

you cannot use them in the replace function


maybe this will work:
Code:
UPDATE jos_flexicontent_fields_item_relations SET value = REPLACE ( value , '> </td>' , '>0</td>' ) WHERE field_id=25 AND item_id=977;


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #52055 by tevez15
Thanks for the help, but didn't work. :|
Attachments:

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #52056 by ggppdk
Well it did not find the string, make sure that you are searching for the correct text, may e you can paste here an exact example


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #52057 by tevez15
The attachment is the code inside field value on BD.. and I want change '[space]' for 0.. but I cant find the solution for the problem above. :roll:

EDIT: So, I try use complete HTML code of td like:
Code:
UPDATE jos_flexicontent_fields_item_relations SET value = REPLACE ( value , '<td class="xl66"> </td>' , '<td class="xl66">0</td>' ) WHERE field_id=25 AND AND item_id=977

And worked for this Item (977) but for general no, because probably the html code is diferent lol
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.343 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save