Jump to content

Scooby08

Members
  • Posts

    244
  • Joined

  • Last visited

Everything posted by Scooby08

  1. Well that was definitely it!! Gotta convert those dates.. Thanks guys..
  2. That has to be why it's not working... Trying that idea out..
  3. I thought this would be easy, but I just can't seem to figure out how to query all the records within the next 24 hours.. I have a datefield for each record like so: 1/7/2010 8:35:48 PM Can't seem to find a solution online either.. Only for the past 24 hours..
  4. Ok I figured out my problem.. I just needed to specify WHERE for my UPDATE.. But I still would like any suggestions on getting the best performance possible for this loop and the queries being ran within.. Thanks again!!
  5. I can't figure out why this loops SELECT statement is only reading the first record?? <?php foreach ($xml->shirts as $shirt) { foreach ($shirt as $color) { $q = "SELECT * FROM shirt_colors WHERE color = '$color->color'"; $r = mysql_query($q) or die(mysql_error()); $dbarray = mysql_fetch_array($r); if (!$row = $dbarray) { $q = "INSERT INTO shirt_colors (color) VALUES ('$color->color')"; mysql_query($q); } else { $q = "UPDATE shirt_colors SET line_sport_type = '$color->color'"; mysql_query($q); } } } ?> Was also wondering if there was a better way to run these queries more effeciently? Thanks to all replies!!
  6. I wasn't alerted.. I just noticed that the information on the page was not up to date..
  7. Thanks for the reply again thorpe! One question though.. For #2, you said the only thing that should stop it is if your cron service is no longer running.. What would make your cron service to no longer be running? Am just trying to figure out why it stopped...
  8. I created a cron job using the following line: * * * * * curl -s http://www.siteurl.com/cron/cron.php I have a couple questions that I cannot find answers to.. 1) What does the -s mean and where can I find documentation on stuff like that? 2) How long will the cron run? I set it up the other day and it was running fine and now I checked it today and it has stopped.. Just curious as to why, and how do I keep it running always? 3) I also don't get any mail from this cron and was curious as to why that is as well.. I read for crons you have to actually place a code snipplet (>/dev/null 2>&1) at the end of the line to not receive email.. I didn't do that so what is stopping emails?? Thanks
  9. tried another /bin/sh: line 0: cd: /home/content/html/include/cron: Not a directory I have to be missing something..
  10. So now I get this: (using your first way, I dont care about the filename) /bin/sh: line 0: cd: /Users/myusername/html/include/cron: No such file or directory Why would that be not found? Isn't /Users/myusername my computer and not the server?
  11. Just using it to grab the latest xml file and update mine.. Just doing this to load the xml file quicker.. I can't figure out any other way to load xml files quicker then if I have a local copy.. I'm open to any suggestions here...?..? <?php $lines = file_get_contents('http://www.externalsite.com/livelines.xml'); file_put_contents('http://www.site.com/include/cron/lines.xml',$lines); ?> Oh yeah.. And I don't have access outside the root directory through godaddy..
  12. By not web accessable are you meaning to put that file outside of the root directory?
  13. It gave me an error with $HOME being set as "/Users/myusername" * * * * * /usr/bin/php -q $HOME/html/include/cron/cron.php Could not open input file: /Users/myusername/html/include/cron/cron.php
  14. Well I guess godaddy just doesn't want cron jobs ran every minute.. They must be blocking them or something.. I don't suppose you'd have any other ideas that could do something similar to a cron job?? ha Thanks for the help thorpe!
  15. Here's what I got.. * * * * * /usr/bin/php -q /home/content/html/include/cron/cron.php ERROR: Could not open input file: /home/content/html/include/cron/cron.php So that part is correct now.. Not sure about the script path though.. I found this inside godaddy's cron settings.. Maybe this might have some helpful info:
  16. I've tried a few... * * * * * php /home/content/html/include/cron/cron.php ERROR: Could not open input file: /home/content/html/include/cron/cron.php * * * * * /home/content/html/include/cron/cron.php ERROR: /bin/sh: /home/content/html/include/cron/cron.php: Input/output error * * * * * /usr/local/bin/php -q /home/content/html/include/cron/cron.php ERROR: /bin/sh: /usr/local/bin/php: No such file or directory Now that last one I'm not sure that /usr/local/bin/php is correct.. That was what was in the tutorial.. Could I be missing something entirely?? Like I'm wondering how this connects to the file on the server that runs the script? Wouldn't it need some sort of a username password set up?
  17. Thanks Thorpe! That helps a ton.. Got a bit further now.. Now, in the command line, it says "You have mail." Seems that each minute I get a new email since that was what I set the cronjob script to do.. But I open that email and it reads this: Could not open input file: /home/content/html/include/cron/cron.php I figured it might be permissions so I ran this: chmod 755 cron.php It still doesnt seem to be working.. Would anybody out there have any ideas as to what I could check on??
  18. Am looking for some help on setting up a simple cronjob.. PHP is installed as CGI.. I simply want to run a php script every minute (30 seconds if possible).. My hosting's through godaddy so I tried using their cron manager first, but the most they allow cron jobs is twice an hour and I need at least every minute.. Now I have read many tutorials on this and cant seem to get anywhere so I'm looking for some extra help here.. I've been looking at this tutorial: http://www.htmlcenter.com/blog/running-php-scripts-with-cron/ And even this tutorial: http://crunchbang.org/archives/2007/10/26/howto-setup-a-crontab-file/ I'm having troubles using the command line and I just need some guidance if possible.. Here's where I'm at.. I opened the terminal, typed crontab -e, tried putting in my command, and from there I don't know how to save it or what needs to be done??? Occasionally it says "-- INSERT --" at the bottom or "recording", but have no idea what that means..
  19. Ok thank you mikesta707.. I'm actually trying to load an xml file that contains live sports feeds, so if anybody out there knows how these guys with sports betting sites load their scores and lines so fast please do leave a reply as to how I could do so.. Thanks guys..
  20. I'm looking for any ideas as to how one would load large xml files, from an external url, and display the contents in the quickest fashion.. Right now I'm loading using "simplexml_load_file" and it takes about 12 seconds to load the file, which is far too long.. Would anybody out there have any ideas on faster loading for this situation?? Any ideas are appreciated.. Doesn't even have to be a php solution.. I just have no idea what to look for to get this to load fast.. I did copy the file locally and it loads super fast.. Maybe there's a way to read that external xml file and save it locally and then I could just read that one.. But then again I have no idea how to set that up as well.. Thanks for any replies..
  21. Could anybody point me into the right direction as to how I could grab an xml feed and save it to my server every minute or so?? Maybe some sort of caching could be done?? Am not sure? I'm open to all suggestions..
  22. For sure! I'm looking up documentation on what you did right now so I can see what all that means.. Thanks a million!!
  23. Awesome! As far as I can see it's working perfectly! Thank you salathe.. You got one more in ya?? hah Say I got these couple of possible strings: o134.5-110 u134.5-110 o9.5-310 u9.5+230 By using something similar to what you just did, how could I make those like so (need 2 ways): 1st way: o134.5-110 = 134.5 u134.5-110 = 134.5 o9.5-310 = 9.5 u9.5+230 = 9.5 2nd way: o134.5-110 = o (-110) u134.5-110 = u (-110) o9.5-310 = o (-310) u9.5+230 = u (+230) Thank you so very much in advanced!!
  24. Well it could be any of these: +7.5-110 -13.5-110 +24.5+310 -9.5+550 +7-1000 -7+5000 where as I'd want: +7.5-110 = +7.5 (-110) -13.5-110 = -13.5 (-110) +24.5+310 = +24.5 (+310) -9.5+550 = -9.5 (+550) +7-1000 = +7 (-1000) -7+5000 = -7 (+5000) The numbers and symbols are never consistent per game (all games have different odds).. they are only consistent as to the format of the original string.. Am gonna try out salathe's suggestion quick..
  25. I'm trying to figure out a way to split up these lines: +7.5-110 -7.5-110 +7.5+110 -7.5+110 Shooting for a way to get this: +7.5 (-110) -7.5 (-110) +7.5 (+110) -7.5 (+110) I was thinking the the split function might be able to get close, but not quite sure how to make that work because I don't know how to make it split at a specific delimiter... Thanks guys..
×
×
  • 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.