#83 Warning: 1 is not a MySQL result index in pollBooth.php3

MySQL_Error
closed-fixed
nobody
Poll (10)
5
2000-09-04
2000-08-17
Agustin Schapira
No

I get the following error after casting a vote:

Warning: 1 is not a MySQL result index in
atthat/public_html/pollBooth.php3 on line 51

Line 51 tries to free a $result mySQL cursor. I've no idea why it generates that error. The problem is not the warning itself, but the fact that the later Header("Location..") command cannot do its job of redirecting the browser:

Warning: Cannot add more header information - the header was already sent (header information may be added only before any
output is generated from the script - check for text or whitespace outside PHP tags, or calls to functions that output text) in
atthat/public_html/pollBooth.php3 on line 52

I added a @to the mysql_free_result call to avoid the warning, but that doesn't really solve the problem...

Discussion

  • I get the same thing. The vote is tallyed but gives this error. If you backup you can see your vote in the results. Does your fix get around that but still register the vote?

    tony

    tony@nowhere.nu

     
  • I get the same thing. The vote is tallyed but gives this error. If you backup you can see your vote in the results. Does your fix get around that but still register the vote?

    tony

    tony@nowhere.nu

     
  • Adding the @ to the mysql_free_result call simply tells PHP to forget about any errors that might occur during the execution of that function. That's all.

    So, to answer your question, yes, it does solve the problem and it does register the vote.

    Agustin

     
  • Yeah... I'm thinking about scrapping the poll code and writing something new for it. I'm also finding that I'm running into trouble when trying to put in additional polls. For some reason, it only pulls the first poll entered. My first thought was that something was wrong with the SELECT MAX(pollid) statement, but I entered that query it over a telnet connection and it worked just fine.

     
  • David Norman
    David Norman
    2000-09-04

    • status: open --> closed-fixed
     
  • David Norman
    David Norman
    2000-09-04

    I just deleted the free_result line.