tomm098 Posted August 26, 2009 Share Posted August 26, 2009 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> Quote Link to comment Share on other sites More sharing options...
ignace Posted August 26, 2009 Share Posted August 26, 2009 if (empty($row_MusicBody['Scene Description']) ^ $row_MusicBody[Author'] === $_SESSION['MM_Username']) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.