Welcome Guest, Not a member yet? Register   Sign In
eh don't worry about it
#1

[eluser]pdxbenjamin[/eluser]
I have a few database tables for my users and on occasion the delete will fail because at times not all the tables have data for that user. How do I structure a delete statement to fail gracefully, and not worry about finding a matching row?

* I'm in the process of cleaning up the validator so fields can't be empty, but for now I need to clean up the old data. *

I just run a bunch of these in a function...
Quote:$did = $this->input->post('did');
$this->db->where('did', $did);
$this->db->delete('address');

$this->db->where('did', $did);
$this->db->delete('work_histor');



Thanks


Messages In This Thread
eh don't worry about it - by El Forum - 02-16-2012, 04:58 PM
eh don't worry about it - by El Forum - 02-16-2012, 08:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB