I want a MySQL field to be able to reference the same field in another row and return that field’s value when loaded into PHP.
For instance, if row with id = 1 has value "bar" in column foo, the row with id = 3 should have value "[1]" (or something similar; the 1 is pointing to the row with id = 1) in column foo and MySQL should replace that value with "bar" when returning the array.
I’m not talking about an UPDATE query. I am trying to build a SELECT query that will make the appropriate replacement. I want [1] to be the permanent value of that row, and reflect whatever foo in the referenced row should happen to be.
You could try something like this but without knowing more, your mileage may vary.
Also, simply use
1, not[1]as the reference valueUpdate
I’d be more inclined to make your table design more specific. For example, try this structure
Then your query can be