Voting Results

var voteConn = null; // voting db connection // get the connection // name connection for debugging purposes // set server timeout to 10 seconds voteConn = project.appPool.connection("checkVoters",10); debug if (voteConn == null) { write('Error: Unable to connect to database'); } // build the cursor to handle results var sql = "SELECT votes.voteskey, votes.yesvote,votes.novote FROM votes"; var voterCursor = voteConn.cursor(sql); if (!voterCursor.next()) { write('

No voters found

'); } else { write(''); write(''); do { write(''); write(''); write(''); } while (voterCursor.next()); write('
questionyesno
' + voterCursor.voteskey + '' + voterCursor.yesvote + '' + voterCursor.novote + '
'); } voterCursor.close(); voteConn.release();

Vote!