We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20751
    • 122 Posts
    You’re welcome . . . great module by the way! Can’t wait to see how this develops!

      • 27305
      • 173 Posts
      still cant use just get the sql error

      « Execution of a query to the database failed - You have an error in your SQL syntax near ’; ’ at line 8 »
      SQL: CREATE TABLE IF NOT EXISTS `modx_polls` ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) default NULL, `question` varchar(255) default NULL, `votes` int(11) default ’0’, PRIMARY KEY (`id`) );
        I made my first site with modx
        ------------------------
        Shopping blog
        Sky+ HD
        • 20751
        • 122 Posts
        Hi simonok,

        Yes, I can reproduce this error now too. It appears that it happens while trying to execute the sql code to create tables at the top of the module. It seems to work when creating the tables for the first time, but when checking if they exist, when they do exist, the sql fails.

        As a temporary measure I’ve just deleted all lines in the module that create the tables. Make sure that they exist first before you do that though! The lines are:

        //-- update db tables if required
        $sqlp ="
        CREATE TABLE IF NOT EXISTS `".$polltable."` (
          `id` int(11) NOT NULL auto_increment,
          `name` varchar(50) default NULL,
          `question` varchar(255) default NULL,
          `votes` int(11) default '0',
          PRIMARY KEY  (`id`)
        );
        ";
        
        $sqlpc ="
        CREATE TABLE IF NOT EXISTS `".$choicetable."` (
          `id` int(11) NOT NULL auto_increment,
          `pollid` int(11) NOT NULL default '0',
          `choice` varchar(255) default NULL,
          `votes` int(11) default '0',
          PRIMARY KEY  (`id`),
          KEY `pollid` (`pollid`)
        );
        ";
        
        $sqlip ="
        CREATE TABLE IF NOT EXISTS `".$iptable."` (
          `id` int(11) NOT NULL auto_increment,
          `pollid` int(11) default NULL,
          `ipaddress` varchar(255) default NULL,
          PRIMARY KEY  (`id`)
        );
        ";
        
        $modx->db->query($sqlp);
        $modx->db->query($sqlpc);
        $modx->db->query($sqlip);
        
          • 16382
          • 36 Posts
          Hi there,

          I am wondering if there is some way I can get the results of the poll to appear in a pop-up window?

          Any help is appreciated
            • 17622
            • 39 Posts
            Hi,

            I haven’t looked at the code yet, but was just wondering if there is a way to limit the ability to vote only to users of particular groups?

            Thanks,
            Luke.
              • 5644
              • 78 Posts
              Is there any way to view poll results in diagramm mode??
                • 5644
                • 78 Posts
                :’(
                  • 9722
                  • 11 Posts
                  I am unable to get the results to show on a results page. I put down what was posted, does anyone have a clue as to why it would not show?

                  I only have one poll which is ID=1 and both codes in the site have that id. It redirects to a page which the id of 28 which I have put that id down in the redirect area. Nothing though..

                  http://www.louisvillefirefootball.com
                    • 9722
                    • 11 Posts
                    does anyone even know if this thing is still supported?
                    • Okay, in reverse order ...

                      @FireMan: It’s still supported (by me) but I’ve been away from MODx for a month or so with various stuff that’s been going on. Now, to your problem, I could really do with seeing your snippet calls that you have entered for the results page - and you need to make sure that either the snippet call or the page is uncached. I’ll be able to help more if I can see the snippet calls though.

                      @collst: An overdue response by me (sorry) but what do you mean by diagram mode? Do you mean like a pie chart or a bar chart - if so, then the answer is no. I’d be interested if anybody knows of any open-source PHP libraries that could do that though, that would be a pretty nice option to build in. (I suppose I could always hack something using GD2)

                      @Lucretia: An even more overdue response to your question. At the moment, the answer is no. I have a new version that I’m writing that will include the ’limit to web group(s)’ option but that is some way from being completed.

                      @krypto: Popup window could be achieved but you’d have to change the snippet code, make the ’Results’ button render as a link instead (that you could then force to open a new window).
                        Garry Nutting
                        Senior Developer
                        MODX, LLC

                        Email: [email protected]
                        Twitter: @garryn
                        Web: modx.com