Jump to content


Photo

change table data


  • Please log in to reply
4 replies to this topic

#1 proctk

proctk
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts

Posted 06 August 2006 - 04:33 AM

below is code that 'm try use create to delete change table data based on the value in a column

if 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 great

thank you

<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';


?>



#2 hackerkts

hackerkts
  • Members
  • PipPipPip
  • Advanced Member
  • 593 posts
  • LocationSingapore
  • Age:18

Posted 06 August 2006 - 05:12 AM

I don't understand what you mean, don't mind explain it alittle more with details ?

Regards,
hackerkts

To be a coder, you must learn how to think and not to give up so easily.


#3 proctk

proctk
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts

Posted 06 August 2006 - 12:56 PM

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.



#4 hackerkts

hackerkts
  • Members
  • PipPipPip
  • Advanced Member
  • 593 posts
  • LocationSingapore
  • Age:18

Posted 07 August 2006 - 06:16 AM

Hmm.. So which part you having difficulty ?

Regards,
hackerkts

To be a coder, you must learn how to think and not to give up so easily.


#5 proctk

proctk
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts

Posted 06 September 2006 - 11:55 PM

How to add to the start date to get the next date until the end date is reached.
creating the loop with the date




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users