PHP: poll problem

liunx

Guest
I've got a poll on one of my clients' site (<!-- w --><a class="postlink" href="http://www.fcoutaouais.qc.ca">www.fcoutaouais.qc.ca</a><!-- w --> - it's in french but I'm sure you'll understand) and for some reason, since he added a new one it doens't work. When you select one and click on "votez!" it doens't record the answer and just spits back the question. It's suppose to spit out the results once you voted. Also, I record the IP so a user can't vote more than once (well... at least not at that same location!) and when the user comes back to the site, I check the IP against the database. If he voted already I show the results if not, show the poll!

I've attached the php as txt file, please help. If you need anything else, I'll provide it!

Thanksare you using PostgreSQL?

although I am not to familiar with that I can only guess at what is wrong.

if($votes_row = pg_fetch_array($votes)) {

in mysql, fetch_array will return an array not a single variable. and

$HTTP_POST_VARS{'resultats'}

really should be

$HTTP_POST_VARS['resultats']

also you have some wierd stuff going on as you have returns in if statements. not neededYes I'm using PostgreSQL.

I know it's $hitty code! :( I took it off a tutorial and try to fix it up a bit.... trust me, it was in worse shape! But... it just seems like it's not putting the stuff in the db!?I would still look into what these variables hold

$votes_row
pg_fetch_array($votes))

those ahve to be something and see what they are by echoing them out.
 
Back
Top