Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: Dunrobin on March 14, 2004, 12:36:33 PM

Title: Voting on Polls error
Post by: Dunrobin 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:
QuoteLEFT JOIN {$db_prefix}log_polls AS lp ON (p.ID_POLL = lp.ID_POLL AND ID_MEMBER = $ID_MEMBER)

should be:
QuoteLEFT 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.
Title: Re: Voting on Polls error
Post by: Grudge 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
Title: Re: Voting on Polls error
Post by: Dunrobin on March 14, 2004, 01:21:55 PM
Quote from: Grudge 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
Thanks, Grudge!
Title: Re: Voting on Polls error
Post by: Spaceman-Spiff on March 20, 2004, 09:34:21 PM
getting the same error

from smf_1-0.sql:
#
# 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:
#
# 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?
Title: Re: Voting on Polls error
Post by: [Unknown] on March 20, 2004, 10:53:37 PM
Please run upgrade.php.

-[Unknown]
Title: Re: Voting on Polls error
Post by: Spaceman-Spiff on March 21, 2004, 02:22:34 AM
fixed, thanks