Jump to content

Greaser9780

Members
  • Posts

    326
  • Joined

  • Last visited

    Never

Posts posted by Greaser9780

  1. Actually what I am looking to do is gather the info(already done). Then I want to take each stat and create a number out of it. Example: A touchdown is worth 6 points. $tdpoints = ($touchdowns * 6).

    So I guess I'm wondering do I need to insert it into a db first and then in another script pull it out and do the math on it, OR can I just do the math somehow before inserting it into the db. Also I am not looking to utilize all the arrays gathered. I just want to use the stats from the day that I am choosing. But with mmy class it extracts all the data after a certain phrase in the page.

  2. Personally I would set up a form for yourself in html. Playername  and new stat field. Then create a php page that the form posts to. In that page you will have something like $player = $_POST['player']; and $stat = $_POST['stat']; Those need to match what you posted. Then connect to your db. Followed by:

    $sql = mysql_query(UPDATE `table_name` SET `player` = '$player', stat = '$stat' WHERE player = '$player'") or die(mysql_error());  

    That should update the stats for you. Or you could always create a dynamic link to a php page that will echo the players name and ask you for the new stat. And upon clicking a submit button it would do my previous update.

  3. Sorry. Here is an example from NFL.com. I scraped a certain years stats then it printed this as the array:

      Array
    (
        [0] => Array
            (
                [0] => Game Log
            )
    
        [1] => Array
            (
                [0] => 
            )
    
        [2] => Array
            (
                [0] => September
                [1] => Rushing
                [2] => Receiving
                [3] => Fumbles
            )
    
        [3] => Array
            (
                [0] => GAMEDATE
                [1] => Opp
                [2] => RESULT
                [3] => GS
                [4] => Att
                [5] => Yds
                [6] => Avg
                [7] => Lg
                [8] => TD
                [9] => Rec
                [10] => Yds
                [11] => Avg
                [12] => Lg
                [13] => TD
                [14] => Fum
                [15] => Rec
                [16] => Yds
                [17] => TD
            )
    
        [4] => Array
            (
                [0] => 09/11
                [1] => @OAK
                [2] => W 27-0
                [3] => Yes
                [4] => 31
                [5] => 131
                [6] => 4.2
                [7] => 58
                [8] => 1
                [9] => 3
                [10] => 18
                [11] => 6.0
                [12] => 10
                [13] => 0
                [14] => 0
                [15] => 0
                [16] => 0
                [17] => 0
            )
    

  4. Possibly. I'm basically looking for an easy way to screen scrape. I tried googling: php screen scrape and found a file I thought would be perfect. A real nice class. The only problem is the login info doesn't get passed properly due to the class. It says it only does logins on sites with basic login procedure. Most sites don't have that. I can't even login to yahoo with it. I understand the concept now but I still have no clue how to pass the login info to the right place via the class.

  5. I would like to create a new SOAP class for a project I want to release next year. I have no clue how to go about this. If anyone has done this before or knows how to do this please leave a response. I know I need it to connect to a certain database or site and retrieve certain statistics and then implement them into a query that will place them in my projects db. I don't necessarily need code here but it certainly wouldn't hurt.

  6. I'd like to set up a way to run a php file everytime the db is updated. I would prolly have to use a require after every single UPDATE query to the db though. Would rather do a trigger but wasn't sure if you could have a trigger run a php file.

  7. I have a timer and another program I currently run as CRON jobs. I would like to utilize a trigger instead though. One script is a check to see if a timer has run out. The other checks to see if a user made a predetermined choice before it is his/her turn to enter their choice. The latter checks if a pre-choice has been made and when it is the users turn updates the db with their info. Since the program I made will be duplicated many times I was wondering if all the CRON jobs would put a large load on the server. In order for the program to seem efficient each CRON would have to run almost every minute or 2. I figure if I can get a trigger to do  it then it would only run when the db is updated. A signifigant server load reduction and better timing for the site.

×
×
  • 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.