Welcome Guest, Not a member yet? Register   Sign In
Active Record Delete Weirdness
#3

[eluser]Lowkase[/eluser]
So,

I took another angle at the same problem. Instead of passing the ID I am passing the IMAGE NAME and try to delete the record using the following code in the color model:

function delete_by_image($image)
{
$this->db->delete( 'colors', array('image' => $image) );
}

This function produces the desired result, only the specified record is deleted and the first record is not deleted.

Have I screwed up the CREATE for the color table?

CREATE TABLE `colors` (
`id` int(11) NOT NULL auto_increment,
`description` text NOT NULL,
`image` text NOT NULL,
`color_code` tinytext,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=latin1;


I can keep moving forward, but the delete by id issue is grating at me.

Thanks for any thoughts.


Lowkase


Messages In This Thread
Active Record Delete Weirdness - by El Forum - 06-29-2010, 02:52 PM
Active Record Delete Weirdness - by El Forum - 06-29-2010, 03:00 PM
Active Record Delete Weirdness - by El Forum - 06-29-2010, 03:02 PM
Active Record Delete Weirdness - by El Forum - 06-29-2010, 03:05 PM
Active Record Delete Weirdness - by El Forum - 06-29-2010, 03:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB