[UPHPU] Table Relationships
Dave Smith
dave at thesmithfam.org
Fri Apr 6 11:04:24 MDT 2007
Mac Newbold wrote:
> I often don't set up the database to enforce my referential integrity
> (though I do have it enforce uniqueness, since that is more critical)
> because I find it really doesn't help me much. If I put the
> constraints in the database, then it kicks my queries back, and I've
> got to gracefully handle a wide variety of possible error situations,
> which takes more programming time and adds more complexity. The
> alternative is to check myself before I do the insert (which often has
> to be done anyway, and has already been checked), and fix it before I
> run a query that fails. Perhaps I just have a bias against failed
> queries, but I prefer to check it first and prevent it from failing
> rather than try it and see.
Do you lock the table so no one does a DELETE between your check and the
INSERT? If not, then the app might not stand up too well to heavy load.
This is why I stand on the other side of the fence. I like to know that
my data is good, even if some bloke uses phpMyAdmin to mess with it.
--Dave
More information about the UPHPU
mailing list