Jump to content

Equations with integers in MYSQL?


kumashiru

Recommended Posts

Is there anyway using php to add, multiply, subtract, etc, integer inside a mysql table?

example..

id|name|int1|int2|int3
[!--sizeo:2--][span style=\"font-size:10pt;line-height:100%\"][!--/sizeo--]1| john | 3 | 2 | 4
2| mary | 5 | 3 | 4[!--sizec--][/span][!--/sizec--]

and i need to subtract john, int1, from mary, int4 and display it for the user to see (display, but not change the data inside the table)

all the numbers are predefined in the table, and there's noway for the user to change them.

any help?
Link to comment
https://forums.phpfreaks.com/topic/3333-equations-with-integers-in-mysql/
Share on other sites

Using the (badly aligned) example above, store int2 from id1, and int2 from id2 into $variable1 and $variable2 then use that to add/multiply/whatever?

how would i go about putting them into variables?

I know I can do this with post/submit deal, but i'm trying to avoid using that.

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.