Greaser9780
-
Posts
326 -
Joined
-
Last visited
Never
Posts posted by Greaser9780
-
-
Try the following:
if ($_SESSION['rank']=='webmaster' | $_SESSION['rank']=='chairman' | $_SESSION['rank']=='secretary' | $_SESSION['rank']=='treasurer') {
-
Nevermind. I figured it out finally. First time messing with arrays. I needed to experiment quite alot.
-
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.
-
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.
-
I was just going to set it up in the same order as the array. I haven't created it yet. Just wondering how the code needs to be structured so that I can run it in a query.
-
Ok now you can scroll it.
-
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 )
-
I am currently running a class to execute screen scrapes from a general stats page. Currently it is set to print out the arrays. How can I utilize and organise this data so I can then enter it into my database?
-
TYVM has definitely pointed me in the right direction.
-
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.
-
I have tried this multiple ways and google searched my but off. I know this can be done. Anyone know how?
-
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.
-
They basically check to see if a program is started.If it is it runs through a series of variables and usually ends up running 1-3 simple queries.
-
What is a good rule of thumb for timing of CRON jobs?I currently run 4 on a site 2 everyten minutes and 2 every minute.
-
Could you please show some code on this?
-
I recently purchased the same book. I like the way it breaks down in chapters and then is problem specific. Once you nail down what the problem is this book shows you how to solve it.
-
You can declare the function for onchange= but the vars and alert need to be in the script I believe.
-
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.
-
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.
-
Here is some code:
$sql2=mysql_query("SELECT * FROM pd WHERE teamid= '$teamid'"); $res2=mysql_fetch_array($sql2); if ($res2['pd1'] = 'NULL' ) { $upd=mysql_query("UPDATE pd SET pd1='$playername',pos1='$pos' WHERE teamid='$teamid'"); require("pdform.php"); exit(); } echo "BLAH";
-
Using update since the default is null. I am using update since I need a where clause to describe which row to update. Otherwise I would just use INSERT. WHERE clause doesn't really work with insert
-
But it's not
-
Close, the problem is I have the default set to null in the db. So it skips right over that accepting null as a value.
-
I know to use fopen() to open the file and fclose() to close it when finished but not sure how to extract the data. Here is a link to different filesystem commands to get you in the right direction:
[SOLVED] one session variable not being destroyed
in PHP Coding Help
Posted
Huh I usually use one with no probs. Lucky so far I guess.