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
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.