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;
'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;
$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
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!
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
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!