I need to design a website heavily relying on a database and was wondering what would do the job better, and why
from what i have seen php is great for designing web pages as long as you know the code
We’ve used both on ChiefDelphi.com
I’d have to say that using PHP/mySQL has been a whole lot easier. I don’t know if its because I do it at work [well, with oracle and php] also, or if its becuase ive been using php/mysql longer and know it better…
either way, i like php/mysql better.
what kind of database system do I hook up to PERL/cgi? my webhoster doesn’t offer my_sql (unfortunately) but I might be able to get telnet access for a limited time.
I learned perl before I learned php, and though they are very similar, I think php is much easier. It’s less learning syntax and more just programming (for example perl has 3 different symbols: one for a string/number ($), an array (@), and an assossiative array (%) while php only has one, $).
You can connect to any kind of database (postgre, oracle, mysql) using perl, you just have to find the right module (http://search.cpan.org/doc/JWIED/DBD-mysql-2.1017/lib/DBD/mysql.pod). I know php can work with postgre and mysql, and it probably would work with all the others, but I’m not sure because I’ve only used it with mySQL.
Also, you can connect to any mysql server from in your script so your database doesnt need to be on the same server as the script. If your host doesn’t offer it you might be able to find someone else who does.
I’m just learning php/mysql right now (so far I can post to a database some information and view it/arrange it nicely, go me! :)). My expierience is that php/mysql are pretty easy to pick up. That and I suggest php/mysql for a simple reason - it’s newer.
My book on ASP has a little description about CGI and why Microsoft made ASP. The server needs to create a new CGI process for every CGI request. If the site is under a lot of stress, this severly limits performance. So Microsoft did something called ISAPI (Internet Server Application Programming Interface). Basically, ISAPI allows it so DLLs are loaded into the same memory space as the server. The server processes requests by executing code from the DLL, which, because is in the same memory as the server, results in no additional process overhead. Basically, “ISAPI applications execute exponentially faster than CGIs, while at the same time making less demands on the server’s memory.”
Now that was from my ASP book. It didn’t really mention anything about PHP, but I’m assuming PHP is also an ISAPI application. What it comes down to is PHP is newer than CGI, and so, was designed with CGI’s faults in mind (looking at it the other way, why make something completely new (PHP) when the old way (CGI) isn’t broken?). If the differences really don’t matter to you (you’re site isn’t going to be under that much stress), look at it this way - are you going to learn something old, or learn something new? Obviously, the old way is going to die out eventually, so my way of thinking is you might as well learn whats going to be used longer - PHP.
DISCLAIMER: All of these facts are what I’ve learned (or atleast think I’ve learned) in my expierience with server-side languages. If you know something I said is complete bs, please tell me. I’d like to know
*Originally posted by Jay Lundy *
I know php can work with postgre and mysql, and it probably would work with all the others, but I’m not sure because I’ve only used it with mySQL.
We’ve hooked PHP to Oracle at work…
Oh, and here is a good article comparing PHP vs PERL
*Originally posted by SuperDanman *
Now, I mentioned ASP. ASP is newer than PHP, so by my logic, ASP should be learned over PHP, which is why I got the ASP book instead of the PHP book (if you’re curious, the improvement over PHP in ASP is “sessions” - these guys store information about unique users in the server’s memory rather than external sources, like cookies or files on the server.
I don’t know if im reading this sentence wrong, but PHP does have very good session handling…
Hmmm, you’re right. I read somewhere that one of the main difference between ASP and PHP is how they handle sessions. I thought it said that PHP doesn’t do it (atleast without using cookies, but from my ASP-centric viewpoint (cause I learned ASP first), thats not really ‘session-handling’ as I learned it), but apparently I’m wrong on that one.
I read over the PHP manual on sessions, and yeah, I did find a difference. "A visitor accessing your web site is assigned an unique id, the so-called session id. This is either stored in a cookie on the user side or is propagated in the URL. " If I’m understanding it correctly, PHP leaves storing the session information up to the user. ASP, on the other hand, when a page is requested, it somehow determines if the user is unique, and based on that information, assigns that user’s “unique information” a session ID - but all this is stored on the server. The PHP manual was kinda vague about whether the variables are stored on the server or the client, but all session information in ASP is stored on the server. The advantages of having it all on the server is that you have total control of the information. In PHP, a user can deny a cookie, and if their browser is closed, they loose the url-encoded information. In ASP, since everything is on the server, every request automatically has a session ID, and keeping this session ID reliable is now part of the server’s job - not the client’s. Now someone can view a page, reboot their computer, go back to the page, and (assuming it’s within the session timeout limit) they’re still using the same session. This gives you a bit more control. Long-term data is still stored in cookies. But again, unless you’re going to use session-specific data in your website and you need this data to be accurate, you’re probably not going to see a major difference in what you can do with ASP as opposed to PHP.
As far as databases go, MySQL is the way to go in my opinion. It is free and it is awesome. I know that some people use Perl scripts to access MySQL databases as well as PHP.
If you need somewhere to host a PHP/MySQL powered website, I would highly recommend http://www.tripod.lycos.co.uk. You get free PHP/MySQL, 50 megs and no advertisements with PHP files. I don’t know if this is a fluke in their advertising system or what, because they do appear on files ending in .htm or .html.
For some reason, PHP/MySQL support is not available on the American Lycos but it is there on the Italian, UK, and some other versions. At least the UK version is in english
*Originally posted by Greg McCoy *
You get free PHP/MySQL, 50 megs and no advertisements with PHP files.
Wow. Thats pretty nice of them.
**I don’t know if this is a fluke in their advertising system or what, because they do appear on files ending in .htm or .html. **