Log in

View Full Version : Switch-off a row



neil665
06-17-2011, 08:53 AM
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...
www.northumberland-coast.co.uk/php/DisplayDBBeadnell.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

djr33
06-17-2011, 06:33 PM
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?

neil665
06-20-2011, 06:34 AM
Hello Daniel

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

Kind regards

Neil