Jump to content

esiason14

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

esiason14's Achievements

Member

Member (2/5)

0

Reputation

  1. Here is the html I'm trying to match: <a href="/mlb/players/playerpage/7652">Tom Gordon</a></td><td width="5%" align="center">RP</td><td width="15%" align="left">Elbow</td><td width="45%" align="left">15-day DL. Out until at least late June</td></tr><tr class="bg2" valign="middle" align="right" height="17"><td width="15%" align="center">04/18/09</td><td width="20%" align="left"><a href="/mlb/players/playerpage/580789">Stephen Drew</a></td><td width="5%" align="center">SS</td><td width="15%" align="left">Hamstring</td><td width="45%" align="left">Questionable for April 19 at San Francisco</td></tr> "The Regex Coach" says this should work, but in practice it doesn't....Is it the % sign? <a href="\/mlb\/players\/playerpage\/([A-Za-z0-9-]+)">(.*?)<\/a><\/td><td width="5%" align="center">(.*?)<\/td><td width="15%" align="left">(.*?)<\/td><td width="45%" align="left">(.*?)<\/td><\/tr>
  2. Hi, Is there a way to simplify this query? SELECT * FROM mlbplayers p, mlbhstats hs, mlbteams t, mlbpositions pos, mlbplayer_positions ppos WHERE ppos.position_id=6 AND p.player_id=hs. player _id AND ppos. player =p. player _id AND hs.mlbteam_id=t.mlbteam_id AND hs.year = 2007 GROUP BY p.player_id ORDER by hs.hr DESC LIMIT 0,10;
  3. Thanks, frost110. A couple of tweaks to suit my needs..and it works like a charm...and I learned a lot from it. Thanks again!
  4. Ok, I gotcha...but I'm pretty sure you can understand my "stupid" question. My problem: I have some arrays that are formatted like this: Array ( [0] => 10811 [1] => 7527,7556 ) What I would like to do is explode the comma separated values (if they exist) My goal: and then add the exploded value as a new key in the array...like this: Array ( [0] => 10811 [1] => 7527 [2] => 7556 ) I've tried several variants of using explode, but I can't seem to work it out. Any help would be appreciated. Thanks for your consideration.
  5. I'm looking to explode the comma separated values in an array like this: Array ( [0] => 10811 [1] => 7527,7556 ) and then add the exploded value as a new key in the array...like this: Array ( [0] => 10811 [1] => 7527 [2] => 7556 )
  6. Thanks! That worked...much appreciated
  7. I have a series of variables that need to be compared against eachother. For example... $ab = 3; $bab = 4; $cab = 5; These will be displayed in a table...Whichever variable has the highest value will be highlighted. How can I compare these without using a gazillion if statements Thanks in advance
  8. This is killing me. I have a muli-tabbed form, each with multiple selects. If more than three selections are made across all the tabs...an alert/confirm shows. Clicking "Ok" clears the form and innerhtml (or should). It looks like it does, but if you click "Ok" and then click on another tab and select another player...the values reappear. Take a look to get a better look at what I'm talking about Select more than three players from multiple tabs. Click ok on the prompt (it looks like it resets) Now click on another tab and select a player ???
  9. I have several multiple select boxes on a page <div id='tabs0' style='position:absolute; top:0; left:0; visibility: visible; margin: 10px;'> <select multiple id=1 name=1 style='font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif; font-size: 11px; width: 350; height: 180' onChange='add_player(this, "1"); return true;' size=10> <?php $count = count($cbs_id); for($i=0;$i<$count;$i++) { if ($pos[$i] == "1") { { echo "<option value=".$cbs_id[$i].">".$lname[$i].", ".$fname[$i]."\n"; } } } ?> </select></div> I'm trying to figure out how I can pass multiple values if the user selects more than one. var c = document.getElementById('1').value; var fb = document.getElementById('2').value; var queryString = "?submit=true&1=" + c + "&2=" + fb; ajaxRequest.open("GET", "newmlbcompare2.php" + queryString, true); ajaxRequest.send(null); If there are multiple c and fb values...how can I pass all of those? Any help would be appreciated!!
  10. I'm parsing my pages to find all id's. What I want to do is: if the id already exists in my db then I want to update it...if not I want to insert a record. How can I go about doing that. Any help would be appreciated. Thanks!! foreach ($url as $value) { $base = "http://www.mypage.com/whatever"; $getit = "".$base."$value"; $input = file_get_contents("$getit"); preg_match_all('@<a href="/whatever/([A-Za-z0-9-]+)">(.*?), (.*?)</a>@', $input, $matches); for($i=0;$i<40;$i++) { $sql3 = "SELECT id from mlbplayers where id=".$matches[1][$i].""; while ($row3 = mysql_fetch_assoc($result3)) { $pid = $row3["id"]; } echo "$sql3<br />"; } }
  11. I have a table that has a whole bunch of <tr>. For each one below I want to match the bolded text. <tr class="bg2" align="right" height="17" valign="middle"><td align="left">DATE</td><td align="left"><a href="/whatever/MATCH THESE NUMBERS">text< /a></td><td align="left">text</td><td align="left">more text</td><td align="left">more text</td><td align="left">MATCH THIS TEXT</td></tr> the numbers to be matched will be like this 3424532 the matched text can have special characters Once the matches are found...I'm going to have to run an update query for each..ie. UPDATE table set text=MATCH THIS TEXT where id=MATCH THESE NUMBERS; any help with the regex would be appreciated. Thanks
  12. ...and I just wanted to add. I do know how to spell "query". It was a typo in the title :(
  13. I have two tables players  [code] `player_id` smallint(5) unsigned NOT NULL auto_increment,   `lname` varchar(50) default NULL,   `fname` varchar(50) default NULL,   `active` tinyint(1) unsigned default '1',   PRIMARY KEY  (`player_id`)[/code] AND rosterplayers [code]  `player_id` smallint(5) unsigned NOT NULL default '0',   `team_id` smallint(5) unsigned default '0',   PRIMARY KEY  (`player_id`)[/code] Each has a player_id field. What I want to do is retrieve a list of players that are NOT in the rosterplayers table. Make sense. I've tried several ways and it's just not working for me. Any help would be appreciated.
  14. Thanks, Nicklas. That's really, really close to what I'm looking for. The only problem I run into is if the string I'm trying to match has other <a href ....then it matches all of the links. I only want to match the ones with /nba/players/playerpage/...... Is there a way to narrow the regex match to only these?
×
×
  • 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.