On 3/14/01, Hubert Earl penned:
>Hi,
>
>I have a review form which is supposed to submit the request to a review
>action file to call a single unapproved joke from a joke database for
>approval or deletion. Instead, the following problems occur:
>
>1. all unapproved jokes appear, except those submitted to the database
>after the form and action file were created.
>2. jokes submitted to the database after the form and action file were
>created never appear.
>
>I'd appreciate help with the code so that the following occur:
>
>1. only one joke appears for review at any one time.
>2. all unapproved jokes can be accessed for review.
This should do it.
DELETE FROM wordjokes
WHERE jokeid = #form.jokeid#
Joke Deleted!
UPDATE wordjokes
SET approved = 1
WHERE jokeid = #form.jokeid#
Joke Approved!
SELECT min(JokeID) as minjoke
From WordJokes
WHERE approved = 0
SELECT JokeID, Joke
FROM WordJokes
WHERE JokeId=#getminjoke.minjoke#
#jokedata2.joke#
No new jokes!
--
Bud Schneehagen - Tropical Web Creations
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists