Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

how to remove "_" in table field?

Quote Reply
how to remove "_" in table field?
I have field on my User tables.

it names country and i have record chere: "Unated_States"

when i pring it(<%country%>) it show me Unated_States

i need Unated Stated(witch out _)



enybody please help to solve it.
Quote Reply
Re: [romanslon] how to remove "_" in table field? In reply to
Why do you bother using an _ ? LSQL supports drop down boxes with spaces...

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] how to remove "_" in table field? In reply to
Hello Endy.Thanks for fast answer!Smile

yes a know about drop box.

but my problem is enother.

i have a global names County(country name stored im my user table with "_" as i have it on my global coutries list), and when customer add link its stored in my user table.

then i try to print it in my links like <%Country%>

its print category name with "_", i need country name without "_".
Quote Reply
Re: [romanslon] how to remove "_" in table field? In reply to
Create a global.. something like 'clean_country' ...

give it the following codes;

Code:
sub {

my $Cat = $_[0];
$Cat =~ s/_/ /g;
return $Cat;
}

Call it in your template with...

<%clean_country($Counntry)%>

That should get rid of the _ for you, and replace occurences of it with a space.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] how to remove "_" in table field? In reply to
WOW, works fine!

Thanks!