Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Poll Booth Errors


defender39

Recommended Posts

I get this error from pollbooth.php while on the a poll page and then clicking VOTE NOW.

1064 - You have an error in your SQL syntax near '' at line 1

 

select voters from phesis_poll_desc where pollid=

 

I think the problem is with the code below. Any help would be great. I am with MS1.

 

case "vote":

  $poll_query=tep_db_query("select voters from phesis_poll_desc where pollid=$pollid");

  $poll_details=tep_db_fetch_array($poll_query);

                $title_query = tep_db_query("select optionText from phesis_poll_data where pollid=$pollid and voteid='0' and language_id = '" . $languages_id . "'");

                $title = tep_db_fetch_array($title_query);

Link to comment
Share on other sites

hmmm... tables are created? you have a poll created? all those poll mgmt settings are set like random etc.?

 

code looks identical to mine from what i can tell...

Link to comment
Share on other sites

I could still use some help here guys....what have I done wrong?

I have every other contrib I installed running very well but this one is giving me a hard time. I cant be the only one who is trying to use it? Does anyone else have it installed at a site I can see? Also if possible could someone post their pollbooth.php if its fixed. I an running php 4.3.2 if that matters. Seems like a sql call problem with the script.

Link to comment
Share on other sites

I could still use some help here guys....what have I done wrong?

I have every other contrib I installed running very well but this one is giving me a hard time. I cant be the only one who is trying to use it? Does anyone else have it installed at a site I can see? Also if possible could someone post their pollbooth.php if its fixed. I an running php 4.3.2 if that matters. Seems like a sql call problem with the script.

send me a pm. we are not allowed to post links to our sites per the TOS.

Link to comment
Share on other sites

Nice site btw.

 

Ok..I have figure out the problem. Seems like that one link is NOT search engine friendly compatible. Now can I get some help on the solution? I have no idea how to fix it. All the other links work great. I prefer to use the SEF links and yes I know the argument that it dont matter but personally...I like the SEF links better.

I think the trouble is in here somewhere...I just dont know how to fix this.

 

break;

case "vote":

$poll_query=tep_db_query("select voters from phesis_poll_desc where pollid=$pollid");

$poll_details=tep_db_fetch_array($poll_query);

                $title_query = tep_db_query("select optionText from phesis_poll_data where pollid=$pollid and voteid='0' and language_id = '" . $languages_id . "'");

                $title = tep_db_fetch_array($title_query);

?>

<tr>

<td align="center"><b><?echo $title['optionText']?></b><td>

</tr>

<?php

$url = tep_href_link('pollbooth.php','op=results&pollid='.$pollid,'NONSSL');

$content =  "<input type=\"hidden\" name=\"pollid\" value=\"".$pollid."\">\n";

  $content .=  "<input type=\"hidden\" name=\"forwarder\" value=\"".$url."\">\n";

for ($i=1;$i<=12;$i++) {

      $query=tep_db_query("select pollid, optiontext, optioncount, voteid from phesis_poll_data where (pollid=$pollid) and (voteid=$i) and (language_id=$languages_id)");

      if ($result=tep_db_fetch_array($query)) {

      if ($result['optiontext']) {

      $content.= "<input type=\"radio\" name=\"voteid\" value=\"".$i."\">".$result['optiontext']."<br>\n";

      }

    }

}

$content .= "<br><center><input type=\"submit\" value=\""._VOTE."\"></center><br>\n";

$query=tep_db_query("select sum(optioncount) as sum from phesis_poll_data where pollid=$pollid");

if ($result=tep_db_fetch_array($query)) {

$sum=$result['sum'];

}

$content .= "<center>[ <a href=\"".tep_href_link('pollbooth.php','op=results&pollid='.$pollid,'NONSSL')."\">"._RESULTS."</a> | <a href=\"".tep_href_link('pollbooth.php','op=list','NONSSL')."\">"._OTHERPOLLS."</a> ]";

  $content .= "</br><center>" . $sum . " "._VOTES."</center>\n";

echo '<tr><td align="center"><form name="poll" method="post" action="pollcollect.php">';

 

echo $content;

echo '<form>';

?>

</td>

</tr>

<?php

break;

}

Link to comment
Share on other sites

Now the other error that some people have posted here about the "warn" error if someone voted already...well as it turns out thats because of the same problem. I havent fixed it yet but I am looking into it. Any help would be great. I am just leaving the multiple votes setting to yes for now but I prefer to have a proper pollbooth with full functions.

Link to comment
Share on other sites

Hey Guyz

 

I downloaded v2.0 plus the updated files,,, and installed it,,

I have went over the forum and the fix'es i find apear to be in the mod already.

However,, I am still getting the following error when someone votes

 

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from phesis_comments where pollid = \'2\' and language

 

select count(select * from phesis_comments where pollid = \'2\' and language_id = \'1\') as total

 

[TEP STOP]

 

any ideals on where to look?

 

I am running ms2

 

Thanks in advance

Regards

Tom

Link to comment
Share on other sites

dear,

 

you can have a look at the pollbooth.php in catalog dir.

 

Open this file and search for:

 

                      $comments_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_NEW_COMMENTS, $comments_query_raw, $comments_numrows);

 

its normally on line 134!

 

Change this to:

 

 

//                      $comments_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_NEW_COMMENTS, $comments_query_raw, $comments_numrows);

 

 

What you done is: taged out this line - This should bring it.

Link to comment
Share on other sites

Joachim

 

Thanks for the reply.

That did give me the solution to fix the problem, although I had previously tried that,, it didnt work for me by commenting the line out,, i had to delete the line alltogether from the file and that took care of it for me

 

Thanks again for taking time to reply

 

Regards

Tom Brock

Link to comment
Share on other sites

I am having similar problems with pollbooth after using mod files.

I will try last thread message.

 

I am also getting this on the cat side:

 

There are no polls that you are eligible for, however you can still view the results of other polls

how do I set eligibility for polls the polls have been set public and open.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

I am having similar problems with pollbooth after using mod files.

I will try last thread message.

 

That has got rid of the sql error. THANK YOU..

 

I am also getting this on the cat side:

 

There are no polls that you are eligible for, however you can still view the results of other polls

 

How do I set eligibility for polls the polls have been set public and open.

 

Appologies for the double post was not being allowed to edit first post.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Ok getting there everything working now, well almost.

 

Still having problems in admin poll config status not changing red/green.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Steve,,,

yea,, I have that problem too,,, only way to close one or make it not public,, is to delete the poll,,

not sure if I am missing something,, or if it by chance is supposed to be this way.

seen others say they have the same problem as well

 

Regards

Tom

Link to comment
Share on other sites

I dont have to delete the poll just click on the colour icons, but since they do not change colour with status and the text does not change, the only way I can find out if the poll is open/closed or private/public is to go into the catalogue and check from that side.

 

Surely this must be a variable query error.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Ok

Still trying to work out the admin config status private/public open/closed red/green so far have these parts to look at

 

admin/polls.php has this starting at line 364

 

<?php 
	 if ($polls['poll_type']==1) {
   echo '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=poll_type&info=' . $polls['pollID'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', _ALT_PUBLIC) . '</a>';
   } else {
   echo '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=poll_type&info=' . $polls['pollID'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', _ALT_PRIVATE) . '</a>';
   }
                 ?>
                </td>
               <td class="dataTableContent" align="center"> 
	 <?php
   if ($polls['poll_open']==1) {
   echo '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=poll_open&info=' . $polls['pollID'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', _ALT_REOPEN) . '</a>';
   } else {
   echo '<a href="' . tep_href_link(FILENAME_POLLS, tep_get_all_get_params(array('info', 'action', 'x', 'y')) . 'action=poll_open&info=' . $polls['pollID'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', _ALT_CLOSE) . '</a>';
   }
	 ?>

 

and admin/includes/languages/english/polls.php has this starting at line 35

 

define('_ALT_REOPEN','Re-open Poll');
define('_ALT_CLOSE','Close Poll');
define('_ALT_PUBLIC','Make poll public');
define('_ALT_PRIVATE','Make poll private');

 

are there any other references for admin side

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Could the admin poll manager be rewritten placing editable values for the status,

 

so that setting to say 1 is private 0 public and the same for open/close instead of the green/red indication that does not work.

 

This would allow setting the same as other parts of admin where different values give different states.

 

Being new to all of this I dont know how difficult a task this would be, but given some pointers in the right direction I would be willing to give this a try.

 

Maybe some of the clever people could be persuaded to help.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

In the coding thread befor last how does the value change?

Would this require an update statement to config?

Is this similar to the code from line 34 through line 52

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...