Jump to content

how can access to this column variable sql by php


fafa0

Recommended Posts

Help you with what? You neither posted the code nor described the problem. Remember: We're not sitting next to you, we don't see what you see.

 

Right now, all I can say is that your database layout is broken. So your first steps would be to learn the basics of normalization and then restructure your database. Maybe that also solves your current problem (whatever that is).

Help you with what? You neither posted the code nor described the problem. Remember: We're not sitting next to you, we don't see what you see.

 

Right now, all I can say is that your database layout is broken. So your first steps would be to learn the basics of normalization and then restructure your database. Maybe that also solves your current problem (whatever that is).

 

How can I call "5" from id=20 as show in pic . I want to update e.x.: 5 to 0 . 

 

05212934913433207995.png

 

I  attached sql file too.

mydb.zip

You should take Jacques1 advice and normalize your data. Updating values within a value is bad practice 

 

But for now you can do the replacement using a query like

UPDATE mytable SET space = REPLACE(space, ' 5 ', ' 0 ') WHERE id = 20

The query will update the row where id = 20 and replace (space)5(space) with  (space)0(space)

If we didn't pad 5 with spaces it will replace all instances of 5 to 0, eg 15 will become 10

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.