Jump to content

WinnieThePujols

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

WinnieThePujols's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Red, See, if you look at the page in the browser versus a page using curl, it's actually quite different. Based on the source code, it looks like milb.com employs a ton of Javascript... the actual stats and tables themselves don't show up in the source code. The only thing you see in the source code itself is (presumably this is what prints the stats): <script type="text/javascript">writeData();</script> So what I'm thinking is: <script type="text/javascript">writeData();</script> EQUALS this image here. Not sure how I'm going to work-around that... Edit: also, about the copyright thing. I think that MLB has conceded that Players and Stats cannot be copyrighted, so do I actually need permission (if just using it for a non-profit site)?
  2. Can you elaborate on that a little bit? "Curl?" Is that like a function or what is it, exactly? Edit: nevermind, I Googled it. Thanks for the suggestion -- I'll look into it!
  3. How do I go about collecting data from another website? Basically what I'd like to do is set up nightly retrieval of data from this site: http://web.minorleaguebaseball.com/milb/stats/stats.jsp?n=Jarrett%2520Hoffpauir&pos=&sid=milb&t=p_pbp&pid=459440 (and other pages on that site) And then have it input into a database on my server. I'd basically want to read everything on that page as a string, and then explode pieces of it into individual chunks that would then be added to a MySQL database... I have no idea where to even start. I asked someone in the past and he called it a "grepper" or something. Can someone please assist me in getting started? In a nutshell... how do I set up automatic retrieval from a separate site? Thanks for the help.
  4. OK, I've been messing around and... if($name == "[player]Scott Rolen[/player]") {     print "Same"; }else{     print "Not"; } ...that returns "Same.."
  5. [color=red]Replace your single quotes when double ones and you'll have your answer...Problem solved. God I'm stupid.[/color] I'm coding a baseball site. I want my users to be able to have a custom tag called player. Basically, they'll type something like [player]His Name[/player], and the two tags will be replaced to a link; a query to the database will be made, his player ID will be found and the correct link will be added. However, for some reason, I always seem to run into this problem when doing a str_replace... Check this out: $name = "[player]" . $first . " " . $last . "[/player]"; When I print that, I get: "[player]Scott Rolen[/player]" (minus the quotes); a strlen tells me it's 28 characters. If I try and substr_count($var, '$name'), I get nothing. However, if I go: substr_count($var, '[player]Scott Rolen[/player]'), it "works". For the heck of it, I did: $test = "[player]Scott Rolen[/player]"; $code = strlen($test); print "<br>$code"; Not surprisingly, that prints out to be 28 characters -- the same as the other one. The original string is: this is a test [player]Albert Pujols[/player] and there is also [player]Scott Rolen[/player] and there is also [player]Jim Edmonds[/player] So can someone please explain THIS: $name = "[player]" . $first . " " . $last . "[/player]"; // printed it equals "[player]Scott Rolen[/player]" $NUMBA = substr_count($var, '$name'); // printing $NUMBA results in a gooseegg (0) $OTHER = substr_count($var, '[player]Scott Rolen[/player]'); // printing $OTHER results in 1... This has to be some common problem or something... help! What am I doing wrong? PS: it's probably a typo if something doesn't matchup as the same... I'm 99% these are the exact same strings (or at least LOOK the exact same when printed out).
  6. I'm thinking maybe my host did something? I don't know what, though. I emailed them asking how I could get access to browse the area where the MYI files would be... they never replied, though. Regardless, I've started doing the occasional backup of my databases so that if it DOES happen, I'll at least be somewhat protected.
  7. It's funny that you say that... the reason I edited the post was just because I didn't feel it was relevant at all. I can't even remember what I posted. I tried doing a lot of different things... I tried backing up the database into a text file hoping there would be just "raw" data, but it was completely empty. You wanna hear the strangest part? Today it randomly fixed itself. I honestly have no clue what happened... I like it, though! Thanks, fenway, for your help. Any time I come here you always lend a helping hand. How this fixed itself I do not know (I checked last night and it wasn't working, but when I got off work tonight it was fine... maybe my host did something?), but it's a nice surprise... it saved me a lot of work!
  8. Edit: nevermind. I can't figure out how to delete this post.
  9. I think they somehow became views when they were messed up... I know I created every table the same way... so in theory, they all should have been the same type. I'm wondering if there was a known problem where problem X somehow causes tables to change into a view or something.
  10. Do these screenshots help whatsoever? [img src=\"http://img124.imageshack.us/img124/4509/picy8uk.jpg\" border=\"0\" alt=\"IPB Image\" /] And this... [img src=\"http://img79.imageshack.us/img79/8599/picx1dd.jpg\" border=\"0\" alt=\"IPB Image\" /] Sorry if they're big.. but they just show up as "views." I'm guessing that won't help at all, but I thought it was worth a try.
  11. See I'm reading up on this, but I don't understand why the USE_FRM repair doesn't work. This is from the MySQL site: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]There is also a USE_FRM mode available for REPAIR TABLE. Use this if the .MYI index file is missing or if its header is corrupted. In this mode, MySQL re-creates the .MYI file using information from the .frm file. This kind of repair cannot be done with myisamchk. Note: Use this mode only if you cannot use regular REPAIR modes. The .MYI header contains important table metadata (in particular, current AUTO_INCREMENT value and Delete link) that are lost in REPAIR ... USE_FRM. Don't use USE_FRM if the table is compressed because this information is also stored in the .MYI file.[/quote] Given that I'm getting the missing "06draft.MYI" error, I'm kinda at a loss as to why this isn't working.
  12. [b]Attempt #1: [/b] [img src=\"http://www.cardsbaseball.net/Clipboard01.jpg\" border=\"0\" alt=\"IPB Image\" /] [b]Attempt #2: [/b] [img src=\"http://www.cardsbaseball.net/error2.jpg\" border=\"0\" alt=\"IPB Image\" /] I don't know what to do! ;_;
  13. [!--quoteo(post=379234:date=Jun 1 2006, 09:30 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jun 1 2006, 09:30 PM) [snapback]379234[/snapback][/div][div class=\'quotemain\'][!--quotec--] Wiped out how? The MYD files didn't vanish, right? If the index is corrupted, that can be fixed. Please clarify. [/quote] "SELECT * FROM recaps r;" returns.. [img src=\"http://img85.imageshack.us/img85/3728/error8tf.jpg\" border=\"0\" alt=\"IPB Image\" /] I guess I don't know how to answer that. Where are the MYD files stored, phsyically-speaking? I don't know how to check that through like an FTP. I've always used GUI programs like the Query Browser so I don't really know. But anyway, the screenshot it when I try to query the table and get all of the rows.. and it says it can't be executed. Edit: Well, I dd some looking into it. It says that if other repair methods don't work (a missing .MYI) I could try this: REPAIR TABLE literature.06draft USE_FRM Unfortunately, it doesn't work... it errors out!
  14. For some reason, two tables from the same database where completely wiped out. I have no idea how this happened. There were other tables in the same database that were completely unaffected... I do know that one guy had access to both of them (and would have been the most recent to use them), but he would have had no malicious intent and is no where near saavy-enough to have done anything... and any access he had to them would have been purely through web-based applications that I made for him. He can only add stuff through them, too... he can't delete. Any idea what could have happened? When I run... "SELECT * FROM literature.recaps r;" In the query browser, I get: "The query could not be executed." And just beneath that part is.. "! Can't find file: 'recaps.MYI' (errno: 2) Thanks for the help. Not really a big loss if these are gone, but I'd like to know what could have went wrong so I can prevent anything like that from happening again.
  15. [!--quoteo(post=365438:date=Apr 16 2006, 10:10 PM:name=ypirc)--][div class=\'quotetop\']QUOTE(ypirc @ Apr 16 2006, 10:10 PM) [snapback]365438[/snapback][/div][div class=\'quotemain\'][!--quotec--] If you are using unix timestamp and the field is an int and you order by it, it WILL come out in order. [/quote] OK, I have a text field instead of int. Could that be causing the problem, or don't you think that would throw it off? I changed it to INT and it worked. Thanks a lot for the help guys, I appreciate it.
×
×
  • 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.