close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Photo Contest voting lookup

Thread began 2/16/2010 11:42 am by robert329616 | Last modified 2/17/2010 12:33 am by robert329616 | 777 views | 5 replies

CraigRBeta Tester

don't worry about the foreign key too much.

for example this means that a value for imageid in the voting table should match an imageid value in the image table.

in this way, if you need to produce a recordset to show all pictures, with number of votes for each, you would start by creating a query with an inner join on this field.

also, a value for userid in the voting table should match a userid value in the user table.
by creating a query with an inner join on this field, you could determine, for example, which user voted for which picture.

heres a quick walkthrough as i see it, (I assume you have dataassist, it's not essential , but makes things easier)

On your voting page, add a recordset to show all of the images, (select * from tblimages will do for starters)
add a dataassist repeating table with one image displayed in each 'cell' (<td> </td> tag)
also, within each cell add...
a form with a vote button
a hidden field with imageid as its data source

when you load your page, you should now see all of your images, with a vote button displayed under each image
your page now has a set of repeating forms, one for each image

now add the dataassist insert record server behavior, so that when the vote button is pressed, the imageid from the form's hidden field, along with your userid value, is inserted into tblvote.
if you wish, redirect to a 'thanks for voting page'.

that should sort it.

Hope this doesn't give you too much of a headache. ps sorry, but i probably won't be online again until the weekend.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...