Jump to content

(TOTAL NEWBIE) Best Way To Achieve Project Goal

- - - - -

  • Please log in to reply
1 reply to this topic

#1
bcc86

bcc86

    Newbie

  • Members
  • Pip
  • 1 posts
Hello,

I am a total newbie when it comes to web development and programming. I have a basic understanding of MySQL, CSS/HTML, and a very small understanding of PHP.

I have built a number of websites using Joomla, but I want to take my knowledge of site building to the next level, starting with creating my own PHP files.

The website I have been working on is for a Baseball Research project. What I am attempting to do is fetch statistics and rosters from websites like this one: STATS Hosted Solution, and display them in my own website.

Since the website is updated daily, I was then hoping to write a script to pull the data from the Stats INC website and store it in a MySQL database. (Preferably using phpmyadmin).

I have done some quick research and have been reading up on cURL, and screen scrapping, however I'm not sure if this is the best way to go about retrieving the information.

Basically I'm just looking for advice on what I need to know and how much research is needed to pull something like this off. (I am currently reading the PHP tutorials on this site and other sites as well.)

Thank you in advance.

#2
iceman4154

iceman4154

    Newbie

  • Members
  • PipPip
  • 26 posts
This idea is actually not as difficult as you may think... Try to think of it as a small list of what you need to do...
1. Get data from Stats Inc. website.
2. Store data in MySQL database (optional).
3. Parse or go through data recovered from Stats Inc. website or stored in MySQL database.
4. Output parsed data to your liking.

Now how would we all this be done in theory?
1.

<?php

$html = file_get_html(/*website url*/);

$divContents = $html->find(/*division name*/);

//google how to use file_get_html(); more thoroughly

?>


2.

<?php

$con = mysql_connect(/*host*/, /*user*/, /*pass*/);

mysql_select_db(/*database name*/);


if(!mysql_query("insert into /*table name*/(/*fields we are inserting into*/) values (/*value of what we are trying to store*/)"))

{

die("fail");

}

?>


The rest is pretty simple and only you can decide how you want to do that part.
Good luck and hope this helps you.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users