php edit data page issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: php edit data page issue

Post by Celauran »

ianhaney wrote:The only issue is the renewal data is being duplicated 3 times
So you're getting 9 rows per user?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: php edit data page issue

Post by Celauran »

Yep. You're inserting on line 88, then again on 104. You've already captured the return value in $result, so just compare against that.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: php edit data page issue

Post by Celauran »

Unrelated, but I've also noticed you have three indices on the same column.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: php edit data page issue

Post by Celauran »

No, I meant this:

Code: Select all

CREATE TABLE IF NOT EXISTS `renewal` (
  `renewal_id` int(11) NOT NULL AUTO_INCREMENT,
  `id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `renewal_date` date NOT NULL,
  `date_notified` datetime DEFAULT NULL,
  PRIMARY KEY (`renewal_id`),
  KEY `renewal_id` (`renewal_id`),
  KEY `renewal_id_2` (`renewal_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=217 ;
You've got a primary key and two additional keys all defined on the same column. No need for that.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: php edit data page issue

Post by Celauran »

You're looking at the columns themselves and not the indices defined on the table. Expand 'Indexes' just below that to see what I'm talking about.
Post Reply