SMF Support > SMF 1.1.x Support

Voting on Polls error

(1/2) > >>

Dunrobin:
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)
--- End quote ---

should be:

--- Quote ---LEFT JOIN {$db_prefix}log_polls AS lp ON (p.ID_POLL = lp.ID_POLL AND p.ID_MEMBER = $ID_MEMBER)
--- End quote ---

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.

Grudge:
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

Dunrobin:

--- 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

--- End quote ---
Thanks, Grudge!

Spaceman-Spiff:
getting the same error

from smf_1-0.sql:

--- Code: ---#
# 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;
--- End code ---

but from my table:

--- Code: ---#
# 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 ;
--- End code ---

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

[Unknown]:
Please run upgrade.php.

-[Unknown]

Navigation

[0] Message Index

[#] Next page

Go to full version