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

No error, but it doesn't add?

Quote Reply
No error, but it doesn't add?
Hi. I'm facing a bit of a dilema here. For some reason, my code will not insert the value into the 'Image' field. In lsql_News.def I have;

Code:
{
'cols' => {
'AccessString' => {
'form_size' => '10',
'form_type' => 'TEXT',
'not_null' => '1',
'pos' => '1',
'size' => '20',
'type' => 'TEXT'
},
'Title' => {
'form_size' => '10',
'form_type' => 'TEXT',
'not_null' => '1',
'pos' => '1',
'size' => '20',
'type' => 'TEXT'
},
'Date' => {
'form_size' => '10',
'form_type' => 'TEXT',
'not_null' => '1',
'pos' => '1',
'size' => '20',
'type' => 'TEXT'
},
'Author' => {
'form_size' => '10',
'form_type' => 'TEXT',
'not_null' => '1',
'pos' => '1',
'size' => '20',
'type' => 'TEXT'
},
'Article' => {
'form_size' => '10',
'form_type' => 'TEXTAREA',
'not_null' => '1',
'pos' => '1',
'size' => '20,20',
'type' => 'TEXT'
},
'Category' => {
'form_size' => '10',
'form_type' => 'TEXT',
'not_null' => '1',
'pos' => '1',
'size' => '20',
'type' => 'TEXT'
},
'Image' => {
'form_size' => '10',
'form_type' => 'TEXT',
'not_null' => '0',
'pos' => '1',
'size' => '20',
'type' => 'TEXT'
},
'Stamp' => {
'form_size' => '10',
'form_type' => 'TEXT',
'not_null' => '0',
'pos' => '1',
'size' => '20',
'type' => 'TEXT'
}

},
'fk' => {},
'fk_tables' => [],
'index' => {},
'pk' => [],
'subclass' => {},
'unique' => {}
};


...and the code I'm having the problem with is;

Code:
my $table = $DB->table("News");
$table->add ( { AccessString => "$AccessString",
Title => "$title",
Date => "$new_date",
Author => "$copyright",
Article => "$article",
Category => "$cat_do",
Image => $url_image,
Stamp => \"NOW()",

} ) or print "$GT::SQL::error"; #

I'm totally stumped. If I look at the query that is executed, it looks something like;

INSERT INTO lsql_News (Title,Author,Date,Stamp,AccessString,Article,Category) VALUES (?,?,?,NOW(),?,?,?)

Note that the 'Image' field is missing.

hAs anyone seen this before? When I was developing my PPC Plugin I had a problem like this, but it was fixed by editing the .def file. That fix doesn't seem to work in this case Unsure

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] No error, but it doesn't add? In reply to
Why have you quoted 6 variables and not the final one? Crazy

You also have pos => 1 for every field.

Try re-syncing

Last edited by:

Paul: May 8, 2003, 2:38 AM
Quote Reply
Re: [Paul] No error, but it doesn't add? In reply to
Yeah, spose that is a bit silly (its because I manaually had to create the lsql_News.def file).

>>>Try re-syncing <<<

How would I do that? I can only seem to re-sync lsql_Category.def and lsql_Links.def Unsure

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: [Paul] No error, but it doesn't add? In reply to
I worked out how to re-sync it. Didn't know you could do it with non-default fields. Its working like a charm now :)

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!