Gossamer Forum
Quote Reply
Add links via script
Hi there Smile,

I am trying to add links to a Links table using the following code


Code:
$linkstbl->add({'CatLinks.CategoryID' => $new_cat_id,
Title => $diveshop->{name},
URL => "http://",
street => $diveshop->{street},
lat => $gps[0],
lng => $gps[1],
zipcode => $diveshop->{zipcode},
phone => $diveshop->{phone},
fax => $diveshop->{fax},
Contact_Email => $diveshop->{email} }) or print $diveshop->{name}." failed to import: ".$GT::SQL::error."\n";

Needless to say, the script croaked with the following message


Code:
Content-type: text/html

<h1>Software error:</h1>
<pre>GT::SQL::Table (14311): Wrong argument passed to this subroutine. $obj-&gt;insert(HASH or HASH_REF or CGI)
only. at /var/home/d4drtools/d4dr-tools.com/www/diveshopdemo/mycgi/admin/Links/Table/Links.pm line 37.
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.

</p>
[Fri Feb 27 05:31:01 2009] importdiveshops.cgi: GT::SQL::Table (14311): Wrong argument passed to this subroutine. $obj->insert(HASH or HASH_REF
or CGI) only. at /var/home/d4drtools/d4dr-tools.com/www/diveshopdemo/mycgi/admin/Links/Table/Links.pm line 37.
Thing is, I think it is time for me to learn what the differences between a hash and a hash_ref are. Since ,apparently, I can't seem to create
one properly. Or if some-one understand what I did wrong in this specific hash/hash_ref (???), please share your knowledge with me Smile

Thanks,
Happy weekend Laugh


Sacrifice is not about what you lose,
it is about what you gain in the process.
Subject Author Views Date
Thread Add links via script EZFrag 3777 Feb 27, 2009, 5:52 AM
Thread Re: [EZFrag] Add links via script
Andy 3670 Feb 27, 2009, 6:09 AM
Post Re: [Andy] Add links via script
EZFrag 3622 Mar 1, 2009, 11:28 PM