Results 1 to 3 of 3

Thread: Switch-off a row

  1. #1
    Join Date
    Jan 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Switch-off a row

    Can any members give advice on the following...

    I operate a UK regional tourism website, advertising holiday accommodation.

    The site displays accommodation listings in table rows, with one table per town / village, an example can be found here...
    http://www.northumberland-coast.co.u...DBBeadnell.php

    The listing details are stored in a MySQL database, administered using phpMyAdmin.

    My question is...
    When using phpMyAdmin, is it possible to ‘switch-off’ a row on a temporary basis,
    then when the owner / agent of the accommodation has paid for the listing,
    switch-it back on?

    Thanks in advance

    Neil

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    There is no literal sense in which you can actually disable a row "physically" in the database.

    But of course you can search in certain ways.

    There are two main strategies for dealing with this, I think:
    1. Create two tables. One is for new reservations, the other for paid reservations. Search whichever is relevant and move reservations from one to the other when the status changes.
    2. Add a field in the table for "paid" with 1 (true) and 0 (false) values. Then when searching add WHERE `paid`=1.

    Unless there is something else more complicated going on, I'd suggest option (2). It's probably easier.

    Does that help?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jan 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello Daniel

    Many thanks for your reply,
    yes, your suggestions are very helpful.
    Will look into revising our site as advised.

    Kind regards

    Neil

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
  •