Jump to content

Diceman

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by Diceman

  1. regardless, i asked a specific question and it was answered with multiple questions instead of a small block of code. that is the point being made. all i wanted was an example so that i could adapt it into my script. after i got the example i requested, i was able to adapt the script and it is now working as desired.
  2. it isnt a direct quote more or less reading between the lines. refer to the first reply to this thread for further insight. if that was not the intent, so be it. just stating how it came across to me.
  3. after some testing, your code works exactly like i want. im getting a few incorrect values here and there but that is purely on the mathematical side of the script. thanks again for all the help.
  4. that seems like it should do what i want. i will need to retrofit it a little but i'll try it out and see what i get. thanks for the information. no disrespect intended towards any parties but i have joined a couple programming forums on an unrelated issue in the past few weeks and every single one of them have done the same thing to me. seems like i cant get a straight answer out of anyone these days.
  5. no, i asked a simple question and all i've gotten as response was "you dont know what you're talking about". if you're willing to answer the question i posed in the first post, great. i got it from there. if not, i'll just hit up another forum for the information.
  6. meh.... i graph poker statistics via cacti, via a php script, via a postgres database that has the stats in it. in order to get the proper values, i have to sql query for the stats i need and then do some math to get the proper values through averaging, division, and multiplication. at that point, it outputs to a single line and my cacti install reads and injects it into rrdtool. all the databases i have done thus far have one limit of play in them. that outputs one line so every variable i get is written to from the query. the new database i have has 15-20 different limits. each limit is outputed on its own line from the sql query but the php script that i currently use gets the variables overwritten for each new line that comes out of the sql query. that means i get 15-20 lines of the same values when it is all said and done from the last line that wrote the variables. i need to have each line tag a number or letter or something on the end to differentiate from the other lines so that each line is able to have math functions executed on it. im not interested in changing the sql query as it is about 50 lines long. doing the math in php is fine with me, i just need a way to keep the variables from overwriting themselves with each new line.
  7. i have a database with poker statistics in it, each row is a different limit. in order to calculate global averages for all limits combined, i need to be able to add x from rows 1-20, then divide by y from rows 1-20, etc.
  8. so im trying to query a postgres database that will return multiple rows. this is just an example of what im wanting to do, not real. say i have a database called employees. i have 10 employee records and each record contains the first name, last name, and age. the data will be returned to me from the database as 10 rows with the first name, last name, and age if i were to select * from *;. now for the tricky part. i want php to assign a variable name to the results, first name = $first_name or whatever, but i want each row's first name to be a different variable. IE, i want to be able to print $first_name1 or something like that to print the first name of the first row and $first_name2 to print for the first name of the second row and so forth for all of the variables, so 10 first names, 10 last names, 10 ages. basically, i need to take all the data that has been returned and do some math with them to get some totals and whatnot, it is long and drawn out. the script im using on single row databases "works" but i get one rows values for all rows since the variables are getting overwritten each time it sees a new row. how do i do that? im thinking an array will do it but i tried reading about them and just got lost. im not that great with php and just need the basic code so i can morph it into a script that can handle this database. if anything in this post isnt clear or doesnt make sense, let me know and i'll try to explain further.
×
×
  • 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.