Advertisement:

Author Topic: Voting on Polls error  (Read 6413 times)

Offline Dunrobin

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
  • Hail, hail, Hailstone! Whahoo!
    • The Three Stooges Online Filmography
Voting on Polls error
« on: March 14, 2004, 12:36:33 PM »
I couldn't vote on a poll I created; I'd just get a database error message.  When I checked the Forum Error Log, I found this message:

Database Error: Column: 'ID_MEMBER' in on clause is ambiguous
File: /../public/Sources/Poll.php
Line: 97

The problem in the query was in line 94:
Quote
LEFT JOIN {$db_prefix}log_polls AS lp ON (p.ID_POLL = lp.ID_POLL AND ID_MEMBER = $ID_MEMBER)

should be:
Quote
LEFT JOIN {$db_prefix}log_polls AS lp ON (p.ID_POLL = lp.ID_POLL AND p.ID_MEMBER = $ID_MEMBER)

That fixed the problem for me.  I didn't see any mention of this error in the threads posted here, so I thought I should add it in case anyone else has run into it.
"Quiet, knumbskulls!  I'm broadcastin'!"

The Three Stooges Online Filmography

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Voting on Polls error
« Reply #1 on: March 14, 2004, 12:44:40 PM »
Interesting. It's fixed in CVS so I guess someone here fixed it at some point. Anyway - your fix isn't quite right. It should be lp.ID_MEMBER and not p.ID_MEMBER.

Thanks

Grudge
I'm only a half geek really...

Offline Dunrobin

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
  • Hail, hail, Hailstone! Whahoo!
    • The Three Stooges Online Filmography
Re: Voting on Polls error
« Reply #2 on: March 14, 2004, 01:21:55 PM »
Interesting. It's fixed in CVS so I guess someone here fixed it at some point. Anyway - your fix isn't quite right. It should be lp.ID_MEMBER and not p.ID_MEMBER.

Thanks

Grudge
Thanks, Grudge!
"Quiet, knumbskulls!  I'm broadcastin'!"

The Three Stooges Online Filmography

Offline Spaceman-Spiff

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,524
  • Gender: Male
Re: Voting on Polls error
« Reply #3 on: March 20, 2004, 09:34:21 PM »
getting the same error

from smf_1-0.sql:
Code: [Select]
#
# Table structure for table `polls`
#

CREATE TABLE {$db_prefix}polls (
  ID_POLL mediumint(8) unsigned NOT NULL auto_increment,
  question tinytext NOT NULL default '',
  votingLocked tinyint(1) NOT NULL default '0',
  maxVotes tinyint(4) unsigned NOT NULL default '1',
  expireTime int(10) unsigned NOT NULL default '0',
  hideResults tinyint(4) unsigned NOT NULL default '0',
  ID_MEMBER mediumint(8) unsigned NOT NULL default '0',
  posterName tinytext NOT NULL default '',
  PRIMARY KEY (ID_POLL)
) TYPE=MyISAM;

but from my table:
Code: [Select]
#
# Table structure for table `yabb_polls`
#

CREATE TABLE `yabb_polls` (
  `ID_POLL` mediumint(8) unsigned NOT NULL auto_increment,
  `question` tinytext NOT NULL,
  `votingLocked` tinyint(1) NOT NULL default '0',
  `maxVotes` tinyint(4) unsigned NOT NULL default '1',
  `expireTime` int(10) unsigned NOT NULL default '0',
  `hideResults` tinyint(4) unsigned NOT NULL default '0',
  PRIMARY KEY  (`ID_POLL`)
) TYPE=MyISAM AUTO_INCREMENT=79 ;

i seem to be missing the last 2 rows
or are they removed but not yet changed in the .sql file?

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Voting on Polls error
« Reply #4 on: March 20, 2004, 10:53:37 PM »
Please run upgrade.php.

-[Unknown]

Offline Spaceman-Spiff

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,524
  • Gender: Male
Re: Voting on Polls error
« Reply #5 on: March 21, 2004, 02:22:34 AM »
fixed, thanks