I’m not keen on how to make an array from database. Tried to avoid learning those but apparently it’s in need for now.
Basically my database is structured with millions of rows. Player Name and Snap (Unix TimeStamp) are usually “duplicated” but with different data in those rows (city, x, y, etc).
Ideally, trying to figure out HOW to make an array via SELECT statement, something like:
Output, I would like would be something like:
Name = Snap => (how many city on those day), Snap => (how many city on another day).. so on..
Question here is, what’s the proper array “command” (if you call that) to pull the name ONCE and pull multiple snap with the counts based on the snap.
My SELECT goes:
// SELECT count(*), player, snap
// FROM DB WHERE GROUP BY snap, player ORDER BY snap, player DESC
while ($row = fetch_assoc($Result) {
// How you go about putting array here?
}
I agree with the comment about needing to read up a little more on the basics, but you can do something like the following, to create your multidimensional array: