sabecs
asked on
Update a MySQL table via a form button?
Hi,
If I have a table as below, how would I update the table using PHP/MySQl/Javascript via an "add to friends" button?
Say if one id was "17" and the other was "46"
Thanks in advance for your feedback.
CREATE TABLE IF NOT EXISTS `friends` (
`id` int(11) NOT NULL auto_increment,
`toid` int(11) NOT NULL,
`fromid` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `friends`
--
INSERT INTO `friends` (`id`, `toid`, `fromid`) VALUES
(1, 17, 2007),
(2, 2007, 17),
(3, 17, 11),
(4, 11, 17),
(5, 17, 26),
(6, 26, 17);
If I have a table as below, how would I update the table using PHP/MySQl/Javascript via an "add to friends" button?
Say if one id was "17" and the other was "46"
Thanks in advance for your feedback.
CREATE TABLE IF NOT EXISTS `friends` (
`id` int(11) NOT NULL auto_increment,
`toid` int(11) NOT NULL,
`fromid` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `friends`
--
INSERT INTO `friends` (`id`, `toid`, `fromid`) VALUES
(1, 17, 2007),
(2, 2007, 17),
(3, 17, 11),
(4, 11, 17),
(5, 17, 26),
(6, 26, 17);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks pratima_mcs for your help, just needed more information.
ASKER