SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Your daddy. WALoeIII's Avatar
    Join Date
    Apr 2001
    Location
    USA
    Posts
    526
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a simple script that allows a user to input some info into my database. But, no matter what I do, there is no way I can make sure that what they enter is relative to what I want. So what I want to be able to do is authorize stuff that is to be added to the database. I don't know where to start here. I'm not asking for the code, just somewhere to start. I have it where the user submits the data, then if I don't like it, I have to go and delete it, I would like it to come to me, I think I could even make a mail script that mails is to me. All I want are the options of delete and add for each one. I could tweak it to let me edit stuff.

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's a thought. Go ahead and save that user data in your database as your script processes the user's input. You might want to ad some code to the form processing script that emails you letting you know a new record has been added and the details.

    However, add a field to the database table and call it "Approved" and make it a varchar(1) with a default value of '0' for false. Then you can write some sort of script that queries the database and retrieves the submissions pending approval. You can read them and decide whether to approve them or not which you can do using a form which will then either update the record in the database and mark it with a value of '1' which flags that it is approved, or delete the record if you reject it.

    Now elsewhere in other scripts, if you want to retrieve all the approved records then as part of your sql query you add "... WHERE Approved = '1' " and that way only the records that have been approved are retrieved (and not the ones pending approval).

    Does that sound like something that would work?

  3. #3
    Your daddy. WALoeIII's Avatar
    Join Date
    Apr 2001
    Location
    USA
    Posts
    526
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    YES YES

    I was trying to over-complicate it earlier. I have a friend that recommende that I use ENUM (ie Yes or No) but the 1 vs 0 thingy would be even easier. Thanks alot.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •