defender39 Posted October 21, 2003 Share Posted October 21, 2003 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); Quote Link to comment Share on other sites More sharing options...
Guest Posted October 21, 2003 Share Posted October 21, 2003 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... Quote Link to comment Share on other sites More sharing options...
defender39 Posted October 21, 2003 Author Share Posted October 21, 2003 Are you using MS1? I installed the latest contrib package. I created 2 polls actually. I have seen this error on other sites too.. maybe you can post your pollbooth.php page for me Quote Link to comment Share on other sites More sharing options...
defender39 Posted October 21, 2003 Author Share Posted October 21, 2003 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. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 21, 2003 Share Posted October 21, 2003 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. Quote Link to comment Share on other sites More sharing options...
defender39 Posted October 21, 2003 Author Share Posted October 21, 2003 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; } Quote Link to comment Share on other sites More sharing options...
defender39 Posted October 21, 2003 Author Share Posted October 21, 2003 woo hooo!!! Fixed it! add this after case "vote": if (isset($HTTP_GET_VARS['pollid'])) {$pollid=$HTTP_GET_VARS['pollid']; } else { $pollid=1; } I am getting better at this. Quote Link to comment Share on other sites More sharing options...
defender39 Posted October 21, 2003 Author Share Posted October 21, 2003 (edited) DELETE Edited October 21, 2003 by defender39 Quote Link to comment Share on other sites More sharing options...
defender39 Posted October 21, 2003 Author Share Posted October 21, 2003 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. Quote Link to comment Share on other sites More sharing options...
defender39 Posted October 21, 2003 Author Share Posted October 21, 2003 YEAH!!! I fixed this too... only do this fix if you have search engine friendly URLS on as it may break again if you shut them off. Change in pollcollect.php around line 49 $forwarder .= "&warn=" . $warn; to $forwarder .= "/warn/" . $warn; Quote Link to comment Share on other sites More sharing options...
romanus Posted October 28, 2003 Share Posted October 28, 2003 Thank god, I thought everyone had given up on this contrib. I don't want you to feel alone so I am replying here. Good work. I am trying it in mine. I don't know if you saw this thread but it may be helpful http://www.oscommerce.com/forums/index.php?showtopic=43568&st=0 Quote romanus Link to comment Share on other sites More sharing options...
charly Posted November 1, 2003 Share Posted November 1, 2003 I have added my updated working files to the contribtion of course all thanks to you guys Quote Charly My fav site Spend most my cash there dont tell the wife:-) Link to comment Share on other sites More sharing options...
Guest Posted November 3, 2003 Share Posted November 3, 2003 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 Quote Link to comment Share on other sites More sharing options...
noisebox Posted November 6, 2003 Share Posted November 6, 2003 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. Quote Link to comment Share on other sites More sharing options...
Guest Posted November 6, 2003 Share Posted November 6, 2003 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 Quote Link to comment Share on other sites More sharing options...
noisebox Posted November 6, 2003 Share Posted November 6, 2003 No prob. :) Quote Link to comment Share on other sites More sharing options...
241 Posted November 9, 2003 Share Posted November 9, 2003 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. Quote 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! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
241 Posted November 9, 2003 Share Posted November 9, 2003 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. Quote 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! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
241 Posted November 9, 2003 Share Posted November 9, 2003 Ok getting there everything working now, well almost. Still having problems in admin poll config status not changing red/green. Quote 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! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
Guest Posted November 9, 2003 Share Posted November 9, 2003 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 Quote Link to comment Share on other sites More sharing options...
241 Posted November 9, 2003 Share Posted November 9, 2003 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. Quote 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! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
241 Posted November 10, 2003 Share Posted November 10, 2003 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 Quote 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! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
241 Posted November 11, 2003 Share Posted November 11, 2003 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. Quote 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! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
241 Posted November 11, 2003 Share Posted November 11, 2003 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 Quote 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! Is your Osc dated try Phoenix raising oscommerce from the ashes. Link to comment Share on other sites More sharing options...
beardeddone Posted November 13, 2003 Share Posted November 13, 2003 I am getting an errpr in the admin/Poll Configuration Fatal error: Call to undefined function: tep_array_merge() in xxxxxx\catalog\admin\polls.php on line 185 Can anyone tell me how to fix it? Quote Best Regards Link to comment Share on other sites More sharing options...
Recommended Posts
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.