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

Re: [Andy] Format of alter_col

Quote Reply
Re: [Andy] Format of alter_col In reply to
Damn it - still having issues :(

Seems that for some reason, the TEXTAREA is not being filled correctly - I was thinking maybe it was cos it needed \r\n - and not just \n ... but that still didn't sort it :/

Code:
my $tbl = $DB->table('AffiliatePrograms');
$tbl->select_options('ORDER BY Name ASC');

my $sth = $tbl->select( ) || die $GT::SQL::error;

my @loop;
while (my $hit = $sth->fetchrow_hashref) {
push @loop, $hit->{Name};
}

print qq|<h2>Updated PartOfAffilite field, with the following entries:</h2>| . join('<br />',@loop);

my $editor = $DB->editor('Links');
$editor->alter_col('PartOfAffiliate', {
type => 'CHAR',
size => '255',
form_names => join("\r\n",@loop),
form_values => join("\r\n",@loop),
form_type => 'SELECT',
form_size => 1,
form_display=> 'Part of Affiliate Program'
}) || die $GT::SQL::error;

...shows fine in the .def file - but obvioulsy not quite formatted right :/

Code:
'PartOfAffiliate' => {
'form_display' => 'Part of Affiliate Program',
'form_names' => 'another test
Program 1
test',
'form_size' => '1',
'form_type' => 'SELECT',
'form_values' => 'another test
Program 1
test',
'pos' => '68',
'size' => '255',
'type' => 'CHAR'
},

Anyone got any suggestions?

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!
Subject Author Views Date
Thread Format of alter_col Andy 7672 Jul 14, 2008, 1:27 AM
Thread Re: [Andy] Format of alter_col
Andy 7535 Jul 14, 2008, 1:42 AM
Post Re: [Andy] Format of alter_col
Andy 7480 Jul 14, 2008, 6:46 AM
Thread Re: [Andy] Format of alter_col
Andy 7484 Jul 14, 2008, 7:46 AM
Thread Re: [Andy] Format of alter_col
brewt 7493 Jul 14, 2008, 3:01 PM
Thread Re: [brewt] Format of alter_col
Andy 7488 Jul 14, 2008, 11:42 PM
Thread Re: [Andy] Format of alter_col
brewt 7470 Jul 14, 2008, 11:55 PM
Thread Re: [brewt] Format of alter_col
Andy 7488 Jul 15, 2008, 12:00 AM
Thread Re: [Andy] Format of alter_col
brewt 7479 Jul 15, 2008, 12:03 AM
Thread Re: [brewt] Format of alter_col
Andy 7495 Jul 15, 2008, 12:09 AM
Post Re: [Andy] Format of alter_col
Wychwood 7445 Jul 15, 2008, 2:15 AM