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] Link to comment https://forums.phpfreaks.com/topic/16682-change-table-data/ 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 ? Link to comment https://forums.phpfreaks.com/topic/16682-change-table-data/#findComment-70046 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. Link to comment https://forums.phpfreaks.com/topic/16682-change-table-data/#findComment-70182 Share on other sites More sharing options...
hackerkts Posted August 7, 2006 Share Posted August 7, 2006 Hmm.. So which part you having difficulty ? Link to comment https://forums.phpfreaks.com/topic/16682-change-table-data/#findComment-70496 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 Link to comment https://forums.phpfreaks.com/topic/16682-change-table-data/#findComment-87480 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.