0 Replies Latest reply on Nov 5, 2007 3:41 PM by (W_Scott_Taylor)

    Create Voting System

    Level 1
      I am trying to create a member voting system.

      I use a recordset to display a Random Member(database row) photo and three details (total of 4 columns, "pic_big", "stage_name", "age", "city", from my database).

      I used the standard Binding Record Set,

      $query_randomMember = "SELECT * FROM JobSeekers WHERE JobSeekers.popularity ORDER BY RAND()";

      That Works great. Now I insert an "Update Record" using 10 radio btns group (voting).

      I got everything almost working for basic voting, but I am wondering how do I select Primary key:

      $upd_JobSeekers->setPrimaryKey("jobseekerID", "NUMERIC_TYPE", "???", "???");

      from the the recordset "randomMember"?

      The next step:

      I was thinking I need to create another database column "popularity_count" to add a value of 1 every time someone votes and keep count of votes...

      How would I take the current value in the "popularity_count" column and add 1 for each vote(update record) and insert that value into "popularity_count"?

      I was then going to take current score (("popularity" * "popularity_count") + the current form value(lets say KT_Update1)) / ("popularity_count" + 1) = the new value(rounded) to put that value back in "popularity".

      Does any one else see that working to get the new value?

      The final step, because this is only accessable to members, I know how to restrict re-voting by SESSION "kt_login_id".

      How would I set the vote vs see results for each member who is voted on?

      I know this seems over whelming but the idea is simple, vote for members by members and stop revoting.

      Does anyone see this a fesible or unfesible?

      Please visit www.sexyexoticjobs.com/included_employers_page.php to get the idea

      If any one knows a script already that will do this for me and allow me to "update" the score to column "popularity" and stop voting based on SESSION that would be helpful.

      Thanks in advance,
      Scott