Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Help splitting a row

Quote Reply
Help splitting a row
I have a row in a table that im trying to have the data split and displayed as 2 different fields

Now im trying to figure out how to display that data where in one textarea there is the MessageTitle(before the comma) and another textarea having the MessageBody(after the comma)

Table name is "settings"

Column name is "value"

the specific row im trying to access has the data MessageTitle,MessageBody

Whats the query for this? and what would be the variable for displaying the 2 values?
Quote Reply
Re: [Brigund] Help splitting a row In reply to
 
Code:
my $sth = $DB->table('Links')->select( { specific selection stuff here } ) || die $GT::SQL::error;

my $field;
while (my $hit = $sth->fetchrow_hashref) {
$field = $hit->{FieldName};
}

$field =~ m/(.+?),(.+?)/;
my $MessageTitle = $1;
my $MessageBody = $2;

...Without more details on the real field names, the table names etc, I'm afraid thats as accurate as I can be.

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!