Jump to content

Find, Replace, Trigger and Grab


laron

Recommended Posts

Just wondering if there is an easy way to do this.

 

I'm trying to find the "true" boolean in a table column (there will only be one), trigger it to false and trigger the next row's same column to true, while grabing that newly triggered column row's id.

 

Example:

 

Table Users

 

id

name

phone

special

1

name1

1234

false

2

name2

1235

false

3

name3

1236

true

4

name4

1237

false

5

name5

1238

false

 

So...

I need to find the row that has has the "special" field set to true, change it to false, change the next row's "special" field to true and get that row's id to store into a variable.

 

If this makes sense, what is the easiest way to do this (after a successful connect to the database).

 

If it doesnt, what more information do you need?

 

 

Link to comment
https://forums.phpfreaks.com/topic/153768-find-replace-trigger-and-grab/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.