Saturday, 15 May 2010

MySQL View doesn't recognize SELECT REPLACE() -



MySQL View doesn't recognize SELECT REPLACE() -

i'm officially stumped. i've created view using code:

alter view event_view select '3' school_id , p.post_title 'short_description' , p.post_content 'description' , e.contact_name 'contact_name' , p.post_type 'post_type' , date( e.start ) 'start_date' , time( e.start ) 'start_time' cm_3_posts p left outer bring together cm_3_ai1ec_events e on e.post_id = p.id p.post_status = 'publish' , p.post_type = 'ai1ec_event' , e.start > now() - interval 30 day , e.start < now() + interval 30 day

however, want strip commas out of info in description field in view. query seems should work, when runs, results show (in phpmyadmin) commas removed, when reload view commas back.

select replace( description, ',', '' ) event_view description '%,%';

my question is, how can permanently remove commas in description column's fields in view? i've tried numerous ways no success. much in advance.

change line in view definition returns description column (i.e. post_content column.)

replace this:

, p.post_content `description`

with this:

, replace(p.post_content, ',', '' ) `description`

mysql replace phpmyadmin views

No comments:

Post a Comment