View Full Version : Swapping Items In A Table

08-05-2012, 11:44 PM
Hi Guys!

Here's a query that all you novice's will most certainly will be able to solve.

I was building a website for my dad and then I got thinking, what if I wanted to do this for a living?

So I started messing around, and this popped into my head, and I cannot figure out how to solve it!

I want to swap information saved in MYSQL database every hour.

For example, in the first hour 'blurb 1' will show, then, at the strike of the hour, 'blurb 2' will show, and the same thing happens until the table is empty.

So basically I need the coding to swap this information, but after each piece blurb has been showed, I want it deleting from that table.

Any chance of a hand guys?



08-06-2012, 11:47 AM
What do you have so far? Have you investigated PHP's prepared statements and methods of interacting with the MYSQL database?

08-06-2012, 02:27 PM
I can connect to my database, My table will be called 'hour_offer' and the columns in that table will be called 'Barcode' and 'OfferPrice'

I have been working on this and scrapped everything I had tried because it wouldn't work! I can list products, and put information on a page using set criteria that links to MYSQL I just cannot figure out this swapping and timing stuff!

any links to example, or anyone who has done this in the past and knows how it works, any advice, it will all be appreciated!