Current location: Hot Scripts Forums » Programming Languages » PHP » Is it possible to lock a MySQL Table?


Is it possible to lock a MySQL Table?

Reply
  #1 (permalink)  
Old 02-12-05, 06:06 PM
Spreegem Spreegem is offline
Newbie Coder
 
Join Date: Jan 2004
Location: In front of my computer
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Is it possible to lock a MySQL Table?

Is it possible to "lock" a MySQL Table so that no more things can be inserted into it after a certain number of things have been inserted? And if table 1 is locked, to insert stuff into table 2, that sort of a thing. Thank You In Advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 02-13-05, 06:21 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
there is a lock option in mysql ..
but it's not what you want http://dev.mysql.com/doc/mysql/en/lock-tables.html
I don't think MySQL offers the feature you are asking for..
but you could do that with the help of php ..
you could count the number of rows in each table, with MySQL's function COUNT() and if it reached the limit you specify, then start in a new table ..
but why would you do that anyway? this will cause you trouble retraiving data as you are going to search in all tables!
database servers came to overcome this problem which was faced when using huge flat files .. but with databases, if you have a good structure, your table could handle millions of records!
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 02-13-05, 10:15 AM
Spreegem Spreegem is offline
Newbie Coder
 
Join Date: Jan 2004
Location: In front of my computer
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Ohh, ok, thanks I was just worried that with thousands or more rows of data that it could take a while to find specific information, so I wanted to break it up, I guess it won't be a problem, Thank You for the help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 02-13-05, 02:23 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
just make sure you have indexes in your tables to speed them up
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
checking table types in Mysql rocky PHP 1 08-01-04 06:06 AM
filling HTML table with MySQL data warrerj PHP 1 05-02-04 07:03 PM
Newbie MySQL fccolon PHP 2 03-16-04 11:54 AM
Replicating table MySQL values lordmerlin PHP 2 01-06-04 12:15 PM
mysql table wcfoone PHP 0 12-18-03 01:31 PM


All times are GMT -5. The time now is 06:36 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.