SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Los Angeles
    Posts
    325
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    limit the # of rows in a table?

    Is it possible to set a limit on the number of rows in a table?

    What i would like to do is insert a row into a table using php...then if that row is the last row allowed for a table, "close" the table so that no more rows can be added ( i dont know if that can be done either) and tehn execute another php function.

    As i'm typing this i'm realizing that one way to do it would be to check a fieldID, but i'm not sure if you can check a fields value before, or even as, you insert the row.
    From here on, it's instinctual...even straight roads meander.

  2. #2
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All you need to do is to check the rowcount before you do the insert, and then simply don't do the insert if it's equal to the limit you want!
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •