Jump to content

Populate array with mySQL data


XJTRy

Recommended Posts

I want to add multiple fields in a single row and put them in a TOTAL field. Simple enough.

 

I'm assuming I have to put the field data into an array, then add the data via the array and return it to the database field (TOTAL) once this is complete.

 

I have been messing with issue for hours with no luck.

 

A session has been created so I don't need to worry about specifying which row to collect field data.

 

I'm not asking for someone to do the work for me. I'm well versed in actionscript functions but my PHP is still very weak. How do I query the database to put field data into array? I want to take column "SUM1" and column "SUM2" from row "$user" and put into array. I think I can handle the rest. Thanks for your time.

Link to comment
https://forums.phpfreaks.com/topic/143350-populate-array-with-mysql-data/
Share on other sites

I'm assuming I have to put the field data into an array, then add the data via the array and return it to the database field (TOTAL) once this is complete.

 

You assumed incorrectly. This can all be done in your query. eg;

 

UPDATE tbl SET total_field = sum1 + sum2;

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.