| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Account Closed Join Date: Oct 2005 Location: United Kingdom
Posts: 1,554
![]() ![]() ![]() ![]() | Auto Update Hi I am making a script and i am going to add a auto-update feature that will use cron job i will tell the cron to run every hour so that it runs a file that will add the first line in update.sql and after it has ran that first line of sql i want it to delete that line so the next hour the second line will be ran and so on, dose any one has a script or code that can do this? |
| |
| | #2 (permalink) |
| Resistance is Futile Join Date: Apr 2006 Location: Montreal, Canada
Posts: 1,094
![]() ![]() ![]() ![]() ![]() ![]() | There is no code in PHP, or any server side language that does this. You have to have a program running on the server itself to do this, unless you have visitors at your site full time it is not guaranteed that it will run properly.
__________________ Freelance Web Developer PHP, MySQL, XHTML, CSS, Javascript, jQuery, Wordpress Portfolio: www.bundy.ca |
| |
| | #3 (permalink) |
| Buy my domains. Join Date: Feb 2006
Posts: 2,796
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code: Code: INSERT INTO whatever VALUES ('you', 'get', 'the', 'point')
INSERT INTO whatever VALUES ('you', 'get', 'the', 'point')
INSERT INTO whatever VALUES ('you', 'get', 'the', 'point')
INSERT INTO whatever VALUES ('you', 'get', 'the', 'point') |
| |
| | #4 (permalink) | ||||
| Senior Member Join Date: Jan 2006 Location: Portland, Oregon
Posts: 2,102
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
__________________ HostingFuze.com Premium Master Reseller Services | 99.9% Uptime Guaranteed SLA | Starting at $4.95/mo Basic Reseller Hosting @ HostFz.com - Services starting as low as $1.95/mo! | ||||
| |
| | THREAD STARTER #7 (permalink) |
| Account Closed Join Date: Oct 2005 Location: United Kingdom
Posts: 1,554
![]() ![]() ![]() ![]() | This dose not work it delete's all the lines when you run it and it dose not put threm into the database i manually wote around 60 lines for DB and this script deleted all of them! Alot of time went down the drain! Dose any one have a proper one. |
| |
| | #8 (permalink) |
| Buy my domains. Join Date: Feb 2006
Posts: 2,796
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Why would you manually write 60 lines?.. and why would you not save it if you knew it was going to delete some of it? I have tested this and it only deletes the first line of the file. You can look at the code and it gets everyline except line 0 [the first line] and writes it to the file. |
| |
| | THREAD STARTER #9 (permalink) | ||||
| Account Closed Join Date: Oct 2005 Location: United Kingdom
Posts: 1,554
![]() ![]() ![]() ![]() | I got it working by removing the ; at the end lol also i put it in cron job to run this file and i get a email every time a cron is run but it had errors it said:
| ||||
| |
| | THREAD STARTER #11 (permalink) |
| Account Closed Join Date: Oct 2005 Location: United Kingdom
Posts: 1,554
![]() ![]() ![]() ![]() | All fixed it, also one last question is there a way i add that if the data already exist (dublicate) the above script will just delete the line and carry one to the next line is there a way to do this? |
| |
| | #12 (permalink) |
| NamePros Regular Join Date: Jun 2004 Location: Iowa City
Posts: 705
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Is this the exact same thing your selling?
__________________ formally ninedogger ------ Want to talk to a stranger? -->| Click Here | TalkToAStranger.com | <-- Meet New Friends |
| |
| | #14 (permalink) |
| Buy my domains. Join Date: Feb 2006
Posts: 2,796
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I didn't say you couldn't sell it, I just said you were selling something you couldn't make and that you got done for free.. I didn't know you were going to be selling it since you asked for help in this thread. How did you change it to a script? It always was one. |
| |