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

Re: [jdgamble] ajax rating system

Quote Reply
Re: [jdgamble] ajax rating system In reply to
So I got it working again and figured out the bug...

Change this line (in the global):

Code:
my $voted = $db->do("SELECT used_ips WHERE used_ips LIKE '%".$ip."%' AND ID='".$id."' ");

to this:

Code:

my $condition = GT::SQL::Condition->new('used_ips', 'LIKE', '%'.$ip.'%');
my $sth = $db->select(['used_ips'], $condition, {ID => $id}) or die $GT::SQL::error;
my $voted = $sth->fetchrow_hashref();

If anyone knows a less complicated way than those 3 lines, please post it.

Now go have fun now,

- Jonathan
Subject Author Views Date
Thread ajax rating system jdgamble 28632 May 26, 2009, 1:24 PM
Post Re: [jdgamble] ajax rating system
Andy 28337 May 27, 2009, 12:34 AM
Thread Re: [jdgamble] ajax rating system
Andy 28341 May 27, 2009, 12:45 AM
Thread Re: [Andy] ajax rating system
tora 12257 Apr 8, 2018, 4:02 AM
Thread Re: [tora] ajax rating system
Andy 12206 Apr 11, 2018, 12:08 AM
Post Re: [Andy] ajax rating system
tora 12200 Apr 11, 2018, 12:46 AM
Thread Re: [Andy] ajax rating system
tora 12194 Apr 11, 2018, 12:52 PM
Thread Re: [tora] ajax rating system
Andy 12185 Apr 12, 2018, 12:59 AM
Post Re: [Andy] ajax rating system
tora 12181 Apr 12, 2018, 1:21 AM
Thread Re: [jdgamble] ajax rating system
tandat 28300 May 27, 2009, 4:53 AM
Thread Re: [tandat] ajax rating system
jdgamble 28262 May 27, 2009, 8:08 AM
Thread Re: [jdgamble] ajax rating system
Andy 28249 May 27, 2009, 8:31 AM
Thread Re: [Andy] ajax rating system
jdgamble 28246 May 27, 2009, 10:38 AM
Thread Re: [jdgamble] ajax rating system
Andy 28309 May 27, 2009, 10:44 AM
Thread Re: [Andy] ajax rating system
jdgamble 28197 May 29, 2009, 11:34 AM
Thread Re: [jdgamble] ajax rating system
Matthias70 28211 May 29, 2009, 11:44 AM
Thread Re: [Matthias70] ajax rating system
jdgamble 28159 May 29, 2009, 6:55 PM
Thread Re: [jdgamble] ajax rating system
jdgamble 28151 May 29, 2009, 10:15 PM
Thread Re: [jdgamble] ajax rating system
jdgamble 28147 May 30, 2009, 7:22 PM
Thread Re: [jdgamble] ajax rating system
Andy 28261 May 31, 2009, 1:58 AM
Thread Re: [Andy] ajax rating system
jdgamble 28057 Jun 6, 2009, 10:48 AM
Thread Re: [jdgamble] ajax rating system
Andy 28146 Jun 6, 2009, 11:05 AM
Thread Re: [Andy] ajax rating system
jdgamble 28096 Jun 6, 2009, 12:42 PM
Post Re: [jdgamble] ajax rating system
Andy 28102 Jun 6, 2009, 11:58 PM