Jump to content

mysql explode sum


rugzo

Recommended Posts

Hi,

 

i have a row which should be updated by every query.

 

id  sum

0    1

 

every time i run the query it should update the sum plus the new value.

 

update x set sum = sum + $newvalue.

 

this works fine.

 

but how can i do that with explode. i need this because this column has to values which are seperated with "_".

like 120_140.

is it possible with sql query that i can do that.

 

as example the current values are

 

120_140

 

the new values are 10_5

 

= 120+10_140+5

130_145

?

 

i know i can do that with php easyly but it must be done via the sql query in my structure ?

 

thanks...

Link to comment
https://forums.phpfreaks.com/topic/171131-mysql-explode-sum/
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.