Question

I have a MySQL database with column 'apps_owned'. Everytime a user buys an app, I want their row to have the AppID added to it. For example,

apps_owned = 1, 4, 75 etc.

How would I do this?

Next, I need to split these up into individual numbers in C#. I don't know how I would remove the comma's to get a whole number. Is there any way of doing this. I know how to get the numbers from the database, I just don't know how to add to them or split them. Is there any easier way to do this?

Pas de solution correcte

Autres conseils

Let the DB do the work, have a table represent a users apps. Then you could simply count, add, delete...

To Split you can do something like:

var result = apps_owned.Split(' ').Select(x => int.Parse(x.ToString.Replace(",", ""))).ToArray<int>();
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top