RE: [PHP-DB] hotornot functionality [resolved]

2003-05-31 Thread Matthew Horn
My apologies for the large email, but I wanted to include all the source code for interested folks and thank everyone who provided suggestions for implementing "hot or not"-like functionality. Here is what I ended up doing. I've stripped out alot of the formatting to make it as readable as pos

Re: [PHP-DB] hotornot functionality

2003-05-29 Thread Becoming Digital
: "Peter Beckman" <[EMAIL PROTECTED]> To: "Matthew Horn" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, 28 May, 2003 10:29 Subject: Re: [PHP-DB] hotornot functionality Uh, why not just do this: Then on the next page, you can get the id. Or geez, it&#x

Re: [PHP-DB] hotornot functionality

2003-05-29 Thread Peter Beckman
Uh, why not just do this: Then on the next page, you can get the id. Or geez, it's gonna be there anyway -- after you do the insert/update of your vote, just pass that ID to the function that displays the page. function display($x) { if (!empty($x['vote'])) { db_query("insert into

Re: [PHP-DB] hotornot functionality

2003-05-28 Thread Mengü Gülmen
I think the best way is to use sessions. when the user comes to the site or he submits a rating, start a session and create a variable, in which you store the images' id that the user rated like $var="1,1423,523" etc.. then use it in your query mysql_query("select id from images where id not in ($v

RE: [PHP-DB] hotornot functionality

2003-05-28 Thread Snijders, Mark
i would do it totally different if i understand you right.. you start with row number one, show it, give it a rate, then show number 2, and show number 1 as last rated pic!!! then you have the problem of reaching the last record!! but !! i also see another problem: if you do row 1,2,3,4 you al

Re: [PHP-DB] hotornot functionality

2003-05-28 Thread Alex Harris
Why not have a field called last in the db? You set it equal to true for the last image and then check it for all of the images. If it's true, you just null the next option and the user can't go any farther. From: Matthew Horn <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [PHP-DB] hotor