Jump to content

Update FORM only if entries are NULL


tomm098

Recommended Posts

Hey all. I have a form that updates three rows in my database.

I only want to let people update a record if a certain field is empty. For example, the three rows are 'Time' and 'Scene' and 'User'. If a scene already exists, I only wanna let the original user edit it. If the User's do not match up, and someone tries to update it, I need the form to reject the update.

 

But if no Scene exists, I want to let anyone add a scene description. Here is the code for the 3 rows.

       <p>
            <input name="Time" type="text" id="Time" value="<?php echo $row_MusicBody['Time']; ?>" />
          </p>
          <p>
            <textarea name="Scene" id="Scene" cols="23" rows="3"><?php echo $row_MusicBody['Scene Description']; ?></textarea>
         <p>
            <input name="User" type="hidden" id="User" value="<?php echo $_SESSION['MM_Username']; ?>" readonly="readonly" />
       </p>
          </p>

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.