Gossamer Forum
Quote Reply
several column addition
 
for plugin i'm developing I need add two columns to Links table
I do it by
my $e = $DB->editor('Links');

$e->add_col('OutgoingHits',
{
size => 20,
type => 'int',
view_size => 20,
nice_name => "OutgoingHits",
regex => '^\d+$'
}
);

$e->add_col('IncomingHits',<br>
{
size => 20,
type => 'int',
view_size => 20,
nice_name => "IncomingHits",
regex => '^\d+$',

}
);

this code works
but in .def file I see the following
'OutgoingHits' => {
'form_size' => '10',
'form_type' => 'TEXT',
'nice_name' => 'OutgoingHits',
'pos' => '21',
'regex' => '^\d+$',
'size' => '20',
'type' => 'int',
'view_size' => '20'
},
'Link_Status' => {
'default' => '0',
'form_display' => 'Link Status',
'form_size' => '5',
'form_type' => 'INT',
'not_null' => '0',
'pos' => '21',
'type' => 'INT',
'unsigned' => '0',
'zerofill' => '0'
},
'IncomingHits' => {
'form_size' => '10',
'form_type' => 'TEXT',
'nice_name' => 'IncomingHits',
'pos' => '22',
'regex' => '^\d+$',
'size' => '20',
'type' => 'int',
'view_size' => '20'
}


see?
there is two columns with the same pos
Link_Status (existing before) and OutgoingHits - new one I've created
this case link edit page not to show OutgoingHits poperty for edit
does anybody know why?

Last edited by:

tamwub: Jul 5, 2002, 1:55 PM
Quote Reply
Re: [tamwub] several column addition In reply to
That's strange, don't know what could cause this.

You might want to check the hash keys you are using:

view_size => 20,
nice_name => "OutgoingHits

should probably be

form_size => 20,
form_display => 'Outgoing Hits',

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] several column addition In reply to
It doesn't work anyway
And now I get another problem
when I do update with
$db->update ( { IncomingHits => \"IncomingHits + 1" }, { ID => $id }, { GT_SQL_SKIP_INDEX => 1,GT_SQL_SKIP_CHECK=>1 } );
it does nothing
when I trace generated query i see
UPDATE lsql_Category SET WHERE ID = ?
and another thing:
$set_opt = bless(
{
'not' => '0',
'bool' => 'AND',
'cond' => []
},
'GT::SQL::Condition'
);

$set = {
'IncomingHits' => \'IncomingHits + 1'
};
so column IncomingHits is not prenent in cols list
I did resyn of table several times - it didn't help
please help me
Quote Reply
Re: [tamwub] several column addition In reply to
Hi tamwub.

You are doing great for writing a plugin similar to mine by the looks of it, and this is your first day on the forum!

Wink


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [tamwub] several column addition In reply to
I looks like the column IncomingHIts does not exist. Non existant columns are usually stripped from a query.

Can you post the whole code related to the creation of the columns?

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] several column addition In reply to
You've right
Column did not exist - I rewrite $db with another table
thank for your help

But pos 21 is steel meets two times in two columns
Quote Reply
Re: [Ian] several column addition In reply to
In Reply To:
Hi tamwub.

You are doing great for writing a plugin similar to mine by the looks of it, and this is your first day on the forum!

Wink

Oh Great
I'm not alone

Can you tell - what your plugin do?