Hi there,
I am trying to update data in the forum_User table.
Here is the script I am using (it is called via AJAX, the script is located in /home/mw/mywebsite.com/cgi-bin/forum):
use CGI;
use strict;
my $query = new CGI;
my $func = $query->param('func');
if($func eq "llUpd"){
my $user = $query->param('id');
my $lat = $query->param('lat');
my $lng = $query->param('lng');
my $result;
use lib '/home/mw/mywebsite.com/cgi-bin/forum/admin';
use GForum qw/$DB/;
GForum::init('/home/mw/mywebsite.com/cgi-bin/forum/admin');
my $user_table = $DB->table('User');
$result = $user_table->update({ user_latitude => $lat, user_longitude => $lng }, { user_username => $user });
if($result)
{
print $query->header;
print "$result lat:$lat lng:$lng";
}
else
{
print $query->header;
print "Update failed.";
}
}
The if statement evaluates true and the result of the print in the true branch is
GT::SQL::Driver::MYSQL::sth=HASH(0xa0b1d60) lat:-29.535229562948455 lng:27.421875
It seems to work, but the columns in the table isn't being updated. Thanks for the help
Sacrifice is not about what you lose,
it is about what you gain in the process.
I am trying to update data in the forum_User table.
Here is the script I am using (it is called via AJAX, the script is located in /home/mw/mywebsite.com/cgi-bin/forum):
Code:
#!/usr/bin/perl -w use CGI;
use strict;
my $query = new CGI;
my $func = $query->param('func');
if($func eq "llUpd"){
my $user = $query->param('id');
my $lat = $query->param('lat');
my $lng = $query->param('lng');
my $result;
use lib '/home/mw/mywebsite.com/cgi-bin/forum/admin';
use GForum qw/$DB/;
GForum::init('/home/mw/mywebsite.com/cgi-bin/forum/admin');
my $user_table = $DB->table('User');
$result = $user_table->update({ user_latitude => $lat, user_longitude => $lng }, { user_username => $user });
if($result)
{
print $query->header;
print "$result lat:$lat lng:$lng";
}
else
{
print $query->header;
print "Update failed.";
}
}
The if statement evaluates true and the result of the print in the true branch is
Code:
GT::SQL::Driver::MYSQL::sth=HASH(0xa0b1d60) lat:-29.535229562948455 lng:27.421875
It seems to work, but the columns in the table isn't being updated. Thanks for the help

Sacrifice is not about what you lose,
it is about what you gain in the process.