proctk Posted August 6, 2006 Share Posted August 6, 2006 below is code that 'm try use create to delete change table data based on the value in a columnif column user_id has a value and column Otheruser_id is balk I want the table row deleted if the column Otheruser_id has a value and the user that has a value in column user_id wants to remove themself form the profile i want to give the option to change the value in the colum user_id to blank If the the value in column Otheruser_id is blank and the user wants to remove themself from the profile then I want the table row to be deleted. hope this makes sense any help is greatthank you[code=php:0]<title>Delete Child</title><?include 'db.php'; $user_id = $_REQUEST['id']; $sql_delete_child = mysql_query("SELECT * FROM children WHERE user_id = '$user_id'OR Otheruser_id = '$user_id'"); $delete_child_found = mysql_fetch_array($sql_delete_child) or die(mysql_error());$chid_id = $delete_child_found['user_id'];$Otheruser_id = $delete_child_found['Otheruser_id'];if($child_id == $user_id){mysql_query("UPDATE children SET user_id = 'null' WHERE user_id='$user_id'");}if($user_id == $Otheruser_id){mysql_query("UPDATE children SET Otheruser_id = 'null' WHERE Otheruser_id='$user_id'");}if($child_id == $user_id and $Otheruser_id <= 0){mysql_query("DELETE FROM children WHERE user_id = '$user_id'") or die(mysql_error()); }include 'getchildren.php';?>[/code] Quote Link to comment Share on other sites More sharing options...
hackerkts Posted August 6, 2006 Share Posted August 6, 2006 I don't understand what you mean, don't mind explain it alittle more with details ? Quote Link to comment Share on other sites More sharing options...
proctk Posted August 6, 2006 Author Share Posted August 6, 2006 I want to give users the ability to remove thier user_id from a table. the columns where their user_id could be found is column "user_id" or "Otheruser_id". There will be a link next to the information that will update the table. Quote Link to comment Share on other sites More sharing options...
hackerkts Posted August 7, 2006 Share Posted August 7, 2006 Hmm.. So which part you having difficulty ? Quote Link to comment Share on other sites More sharing options...
proctk Posted September 6, 2006 Author Share Posted September 6, 2006 How to add to the start date to get the next date until the end date is reached. creating the loop with the date 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.