Auto serverside program running...?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Auto serverside program running...?

Postby eyewoo » Sun Mar 16, 2003 6:41 am

Up till now, I've always been a clientside website developer. Serverside developing is opening up a bunch of interesting ideas... Here's one I'm wondering about.

I've developed a website for my artwork in PHP. One of my reasons for using PHP was to be able to count the number of times my illustrations had been viewed. I've set up some counters, that write to two files. A temorary count and permanent count file. Every night I zero out the temp counter file... so... being serverside, I wondered whether it is possible with PHP to set up a program that automatically zero's out the temp files??? My server is not here - I use a commercial ISP (webaxxs.com), so is that possible without having my ISP having to do something?

I put up the first PHP version of my artwork site last night. It's at http://www.eyewoo.com if you have a moment to have a look... 8)

Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

Postby Xerpher » Sun Mar 16, 2003 12:20 pm

Well, I don't know about that, but if you have access to a MySQL database you should use it instead of a file... then tell php to just add a new row of data each day. That's what I have right now, if you have access to such a database, I can help you set it up.

eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Postby eyewoo » Sun Mar 16, 2003 1:23 pm

Xerpher... nope. Not yet for MySQL... That's a whole nuther thing that I may take up one day, but it's just not needed at the moment. I'm not dealing with that much data and I don't need to massage it in any way other than what I can easily do with Excel.

Thanks for the offer.... 8)

Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

Postby Xerpher » Sun Mar 16, 2003 4:43 pm

Well you don't need A LOT of data for MySQL, and it's a million times easier than you could imagine, but if you wish :roll:

eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Postby eyewoo » Sun Mar 16, 2003 4:50 pm

Hey... I'm overwhelmed with stuff right now... I just started with PHP last week... Let me get a bit more comfortable with it, eh! 8O

Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

Postby Xerpher » Sun Mar 16, 2003 6:16 pm

Lol, well still... look how easy mysql is:

Code: Select all

<?php
$db = mysql_connect("localhost", "user", "password");
mysql_select_db("databasename",$db);
$result = mysql_query('SELECT * FROM mytable',$db);
$row = mysql_fetch_row($result);
?>


:roll: :wink: :P

eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Postby eyewoo » Mon Mar 17, 2003 5:51 am

OK...OK... :) Tell me more.

1) Is there separate database software to purchase for using MySQL? If so, what's the cost?

2) ...or, is the database available as freeware?

3) Can files, like graphic images or documents, be stored in such a database, or can only links to files be stored?

4) Is there a good online resource about MySQL?

Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

Postby Xerpher » Mon Mar 17, 2003 3:26 pm

1) You need the MySQL software on the server (much like how PHP needs to be installed) which you get from http://www.mysql.com.

2) It's free...
All of our products are available under open source licenses, but we also sell commercial licenses for all of the products so they can be adopted in situations where an open source solution is not appropriate.

3) You can put links to or full documents in the database, but beware, larger files will slow down the performance of your database. It's recommended to leave them as links.

4) Not really that I know of... but all you really need is the code I already posted and change "mysql_query('SELECT * FROM mytable',$db);" to whatever data you need. http://www.mysql.com gives you documentation on queries, but its still pretty basic: SELECT => choses what to get, FROM => choses which table in the database, WHERE => (ex: WHERE username='joe') only retrieves rows of data where the column "username" contains "joe"...

If you need help with queries or want to make some better and more efficient code for accessing your db, just ask here or email me (xerpher@terradesign.ws) and I'll help you. By the way, do you host your own server yourself? or are you with a hosting company (and which one)?

eyewoo
New php-forum User
New php-forum User
Posts: 71
Joined: Sun Mar 09, 2003 10:29 am
Location: Pennsylvania, USA
Contact:

Postby eyewoo » Mon Mar 17, 2003 4:37 pm

Thanks for the help Xerpher... I'm hoping to get at it, the mySQL sometime in the next few weeks.

I use webaxxs.com for my servers. I have several sites with them...

http:www.eyewoo.com
http:www.taxrecover.com

and I'm about to move http:www.uiux.com over to their servers. I have it with another host now that I'm not real happy with.

And... there's also http://www.fleabrain.com hosted with a third host that offered a year's hosting for $35. But they really suck.

Webaxxs offers a pretty good deal at $59/month for a dedicated server with unlimited domain names - 3 GB of HD space and 20 gig of bandwidth/mo. I'm thinking about moving everything onto that package. I'm paying about that for all the other hosting now.


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests