Jump to content

Multiple rows edit.


jacobmukalel

Recommended Posts

- Generation Time: Aug 02, 2010 at 06:22 AM
-- Server version: 5.0.91
-- PHP Version: 5.2.8

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `leapaddemo`
--

-- --------------------------------------------------------

--
-- Table structure for table `rp_user_occupants`
--

CREATE TABLE `rp_user_occupants` (
`occupant_id` int(11) NOT NULL auto_increment,
`occupant_name` varchar(100) NOT NULL,
`occupant_dob` date NOT NULL,
`occupant_relation` varchar(100) NOT NULL,
`occupant_ssn` varchar(100) NOT NULL,
`rp_user_id` int(11) NOT NULL,
PRIMARY KEY (`occupant_id`),
KEY `rp_user_occupants_ibfk_1` (`rp_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=51 ;

--
-- Dumping data for table `rp_user_occupants`
--

INSERT INTO `rp_user_occupants` VALUES(1, 'sanju', '2010-06-04', 'myself', '123654', 1);
INSERT INTO `rp_user_occupants` VALUES(2, 'jinson', '2010-07-07', 'frnd', '234245', 2);
INSERT INTO `rp_user_occupants` VALUES(3, 'james', '2010-07-16', 'frnd', '234245', 2);
INSERT INTO `rp_user_occupants` VALUES(4, 'sanju', '2010-07-30', 'friend', '789', 55);
INSERT INTO `rp_user_occupants` VALUES(5, 'james', '2010-07-30', 'friend', '852', 55);
INSERT INTO `rp_user_occupants` VALUES(6, 'james', '2010-07-09', 'friend', '789', 56);
INSERT INTO `rp_user_occupants` VALUES(7, 'syam', '2010-07-16', 'friend', '852', 56);
INSERT INTO `rp_user_occupants` VALUES(8, 'jinson', '2010-07-16', 'friend', '456', 56);
INSERT INTO `rp_user_occupants` VALUES(9, 'james', '2010-07-02', 'friend', '789', 58);
INSERT INTO `rp_user_occupants` VALUES(10, 'syam', '2010-07-10', 'friend', '852', 58);
INSERT INTO `rp_user_occupants` VALUES(11, 'asdas', '2010-07-29', 'asdas', '', 60);
INSERT INTO `rp_user_occupants` VALUES(12, 'sdfgd', '2010-07-30', 'sdfgdf', '', 60);
INSERT INTO `rp_user_occupants` VALUES(13, 'syam', '2010-07-28', 'friend', '111111111', 61);
INSERT INTO `rp_user_occupants` VALUES(14, 'james', '2010-07-28', 'friend', '222222222', 61);
INSERT INTO `rp_user_occupants` VALUES(15, 'jinson', '2010-07-15', 'friend', '333333333', 61);
INSERT INTO `rp_user_occupants` VALUES(16, 'james', '2010-07-28', 'friend', '111111111', 62);
INSERT INTO `rp_user_occupants` VALUES(17, 'syam', '2010-07-29', 'friend', '222222222', 62);
INSERT INTO `rp_user_occupants` VALUES(18, 'jinson', '2010-07-29', 'friend', '333333333', 62);
INSERT INTO `rp_user_occupants` VALUES(19, 'siva', '1977-07-07', 'wewee', '111111111', 59);
INSERT INTO `rp_user_occupants` VALUES(20, 'ASIT', '2002-07-11', 'FRIEND', '619072345', 63);
INSERT INTO `rp_user_occupants` VALUES(21, 'Arati', '2010-07-17', 'Married', '619052731', 63);
INSERT INTO `rp_user_occupants` VALUES(22, 'aaaaaa', '2010-07-29', 'aaaaaaaa', '111111111', 64);
INSERT INTO `rp_user_occupants` VALUES(23, 'aaaaa', '2010-07-14', 'aaaaaaaaaaaa', '111111111', 64);
INSERT INTO `rp_user_occupants` VALUES(24, 'bbbbbbbbb', '2010-07-30', 'bbbbbbbbbbb', '111111111', 64);
INSERT INTO `rp_user_occupants` VALUES(25, 'werwerw', '2010-07-15', 'esdf', '23423232', 82);
INSERT INTO `rp_user_occupants` VALUES(26, 'werwerw', '2010-07-15', 'esdf', '23423232', 82);
INSERT INTO `rp_user_occupants` VALUES(27, 'james', '1986-04-22', 'friend', '3433434', 2);
INSERT INTO `rp_user_occupants` VALUES(28, 'james', '2010-07-06', 'friend', '45645456', 2);
INSERT INTO `rp_user_occupants` VALUES(29, 'syam', '2010-07-13', 'dfg', '545454', 2);
INSERT INTO `rp_user_occupants` VALUES(30, 'jhhgj', '2010-07-13', 'hgj', '657677657', 2);
INSERT INTO `rp_user_occupants` VALUES(31, 'syam', '2010-07-30', 'friend', '111111111', 88);
INSERT INTO `rp_user_occupants` VALUES(32, 'james', '2010-07-30', 'friend', '111111111', 88);
INSERT INTO `rp_user_occupants` VALUES(33, 'test occupant', '2000-07-21', 'test', '000', 89);
INSERT INTO `rp_user_occupants` VALUES(34, 'test occupant', '2010-07-16', 'test relation', '000', 89);
INSERT INTO `rp_user_occupants` VALUES(35, 'james', '2010-07-07', 'fff', '222222222', 2);
INSERT INTO `rp_user_occupants` VALUES(36, 'james', '2010-07-01', 'fgdfg', '123456789', 2);
INSERT INTO `rp_user_occupants` VALUES(37, 'werwerw', '2010-07-15', 'esdf', '23423232', 82);
INSERT INTO `rp_user_occupants` VALUES(38, 'werwerw', '2010-07-15', 'esdf', '23423232', 82);
INSERT INTO `rp_user_occupants` VALUES(39, 'werwerw', '2010-07-15', 'esdf', '23423232', 82);
INSERT INTO `rp_user_occupants` VALUES(40, 'werwerw', '2010-07-15', 'esdf', '23423232', 82);
INSERT INTO `rp_user_occupants` VALUES(41, 'werwerw', '2010-07-15', 'esdf', '23423232', 82);
INSERT INTO `rp_user_occupants` VALUES(42, 'werwerw', '2010-07-15', 'esdf', '23423232', 82);
INSERT INTO `rp_user_occupants` VALUES(43, 'dhoni', '2010-07-29', 'dhoni', '222222222', 90);
INSERT INTO `rp_user_occupants` VALUES(44, 'dhoni', '2010-07-29', 'dhoni', '333333333', 90);
INSERT INTO `rp_user_occupants` VALUES(45, 'ertertert', '2010-07-15', 'fff', '345453455', 82);
INSERT INTO `rp_user_occupants` VALUES(46, 'dgfg', '2010-07-15', 'dfgdf', '444332222', 91);
INSERT INTO `rp_user_occupants` VALUES(47, 'dhoni', '2010-07-28', 'frnd', '222222222', 92);
INSERT INTO `rp_user_occupants` VALUES(48, 'dhoni', '2010-07-28', 'frnd', '222222222', 92);
INSERT INTO `rp_user_occupants` VALUES(49, 'fdgdfg', '2010-08-06', 'fgdg', '233223', 91);
INSERT INTO `rp_user_occupants` VALUES(50, 're', '2010-07-31', 'errrre', '223422342', 91);

 

 

I want to edit these fields based on 'rp_user_id' field. I have to show them and update them to database. How. Please help me.

Link to comment
Share on other sites

$rp_user_id = $_POST['rp_user_id'];//rp_user_id 

$result = mysql_query("UPDATE rp_user_occupants SET occupant_name ='".$_POST['occupant_name']."', occupant_dob ='".$_POST['occupant_dob']."', occupant_relation ='".$_POST['occupant_relation']."', occupant_ssn ='".$_POST['occupant_ssn']."' WHERE rp_user_id='".$_POST['rp_user_id']."'") 
or die(mysql_error());  

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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