XJTRy Posted February 1, 2009 Share Posted February 1, 2009 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 More sharing options...
trq Posted February 1, 2009 Share Posted February 1, 2009 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; Link to comment https://forums.phpfreaks.com/topic/143350-populate-array-with-mysql-data/#findComment-751855 Share on other sites More sharing options...
XJTRy Posted February 1, 2009 Author Share Posted February 1, 2009 That enlightening and disappointing all at the same time. :-\ Thank you. I feel like an idiot. Guess I didn't need to sleep last night anyway. Link to comment https://forums.phpfreaks.com/topic/143350-populate-array-with-mysql-data/#findComment-751964 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.