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
https://forums.phpfreaks.com/topic/171924-update-form-only-if-entries-are-null/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.