Jump to content

getting the product from 2 arrays.


idos

Recommended Posts

I'm making a script where i want to multiply  from 2 columns in a mySQL database and sum the product.

1 User submit values in a form  (grade and accent style(in climbing)) (they see a string but the values are  int.)
2 Theese values are stored in a db
3 i use a quiery to display them in a table but now and the numbers are converted to strings from an array.
4 i multiply the grade and the accentstyle integers and get the individual score the route produced..


so far so good

5 i now want to sum the individual route score to a scoretotal for each person, but so far i haven't managed to both multiply the  2 columns and sum them.  i have tried to create a multidimentional array and use array_product($multidimarray)  but with no luck so far...

can some one please help... 




[attachment deleted by admin]
Link to comment
Share on other sites

Hmm well i still can't get it to work.

But i have  altered the form and insert.php to insert  the score in the database.

I can get the  total score in MyPHPadmin  using this quiery:

[quote][code=php:0][code=php:0]$sql = 'SELECT SUM(score) FROM `ruter` WHERE Navn = \'"username"\' ORDER BY `Grad` LIMIT 0,20';[/code][/quote]

So my question is: How can i display the SUM(score) result from the database...
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.