Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL Table Locks

Status
Not open for further replies.

Itshim

Programmer
Apr 6, 2004
277
US
I need to use table locks for a class to maintain data integrity. Problem is I've never used them before. I've read and understand the MySQL documentation. My problem is how to incorporate them into my PHP class.

For example:
I wrote a class to create and maintain a hierarchical recursion tree. When the function CreateCategory is called I need to lock the category table and the correlation table to ensure no other category with the same name exists on that level of the tree.

The CreateCategory function uses several other functions to perform checks and whatnot. So do I simply lock the needed tables at the beginning of the Create function and unlock at the end?

Note: I cannot use transactions with my version of MySQL, and cannot upgrade...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top