Hi there,

I have 2 columns in my mysql table, (1) Status (2) Type.

For the status column I would like to have one row with a STATUS of 1 (live). And all the rest to have a STATUS of 0 (hidden).

Is there a way to change a row to live and have the other one revert back to 0 in the same SQL statement? I only want to have one row active at a time.

Also, I have 2 options to specify for TYPE column, would I be best to use enum for this column and how would a specify the correct syntax?

My mysql knowledge is only basic. Any help would be appreciated.

Thanks

It's all good I think I'll have to update before insert. But maybe I could have used a trigger or something.

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.