Adding Database To A Website

Some basic questions (some perhaps verging on the stupid, but bear with me) about making a database accessible on my non-commercial website. I want visitors to be able to run searches to pull up sets of records (no editing, just viewing). My database is currently in Paradox, I don’t mind moving it to some other platform if necessary. I’ve been reading up on the PHP/MySQL/Apache combo. I understand the pure programming aspects just fine, but I have some practical questions that have me baffled:

  1. What’s with Apache and why do I need it? Why do I need a web server when I already pay to have my website on a host? Is this for setting up a local testbed? If I’m willing to run my tests directly on my real website, do I have any need of Apache?

  2. Can MySQL interface with a Paradox database, or do I need to migrate it to a native MySQL database? I’ve read vague mutterings that MySQL is compatible with ODBC databases, but what are the practical details of actually making it work?

  3. Are PHP and MySQL typically pre-installed on a web server so that all you do is make the calls, or do I have to do setup on my end? Much is made of Unix vs. Windows servers, but what difference would it actually make to me?

  4. Are there other better methods of getting where I want to go? I’m looking for a relatively painless way to get this database onto my website, but I do want the flexibility to make the interface custom, so I’m not looking for some canned solution that doesn’t allow me any room to flex my creative muscles on the app. ColdFusion is mentioned in places, but looks expensive and over-the-top complex. Suggestions?

Apache is the Linux web server of choice. It is basically IIS for Linux.

If your Web host is a *nix host, it’ll be running Apache. If it’s Windows, it’ll be running IIS.

If your computer at home is a Windows machine, you’ll have IIS or uhm…something else like IIS that came with Win98 (Personal Web maybe??) If your computer at home is Linux, then you either have Apache or need to install it.

You are correct in thinking that needing Apache at home only applies if you want to run a test web server at home.

I am not really familiar with Paradox (I did Google it some) but Paradox is its own thing - a database. MySQL is also a database. You would need to ask your host if they support Paradox, or just MySQL, or any other DBs they support (Access, SQL, etc) So if they support Paradox you can use that, but if they don’t and they only support MySQL, you have to use that.

Unix/Windows wouldn’t make much of a difference to you on your end. You should ask your host if they support PHP and MySQL. You can’t install them yourself on your host nor is there anything you need to do to set them up. I am assuming, however, that you do need to ask your host what your MySQL login info is and perhaps how to make a connection string.

IMHO PHP and MySQL is going to be the easiest, cheapest way to go and if you are not familiar with PHP it is fairly easy to learn. If you do decide you want to run a test environment locally you can download and install PHP and MySQL for free on any machine (Windows or Linux).

Cold Fusion…eh…in my opinion yes it is kind of complex and bloaty and I am not exactly sure what it can do that PHP can’t.

There are also countless free help forums and sites online, really great communities of PHP coders who are used to helping out “newbies” and you will have no problem getting help from them.

However…IANAPHPCOMySQLU (I am not a php coder or MySQL User) so hopefully someone with more info will come along shortly. :smiley:

Except for all those Windows boxes running Apache.

Apache will run on Windows and there are a lot of reasons to do it. If you want to run ASP or ASP.NET code, you run IIS. If you want to run PHP, JSP, Java servlets, etc. on Windows, you can run Apache. In general (with few exceptions) things like PHP and Java server-side code are platform agnostic and you can develop on a Windows box running Apache and deploy to a Linux box running Apache without issues.

:smack: I KNEW I was gonna get called on that. But really I was generalizing the concept of what Apache is as compared to IIS (thought maybe the OP would know what at least one of those are)

FTR…my windows server serves both PHP/MySQL/Java servlets and ASP…and it only runs IIS. So you don’t NEED Apache to run such things but as you say yes it can be done.

For your test system, you may want to consider an installation kit, which installs Apache/PHP/MySQL on your machine (kits available for Windows and Linux), quickly, and with no headaches. I’ve had good experiences with some of the free kits for Windows.

LAMP - The Open Source Web Platform

And you can run ASP under Apache, but that’s not the point. All I was trying to say is that, contrary to your original post, you can run Apache on Windows. And if you’re doing development that may ultimately be deployed on Apache, it may be convenient to run your development environment on windows regardless of what OS the production server uses. In fact, I run a few production servers that use Apache on Windows because it was better for those specific instances than IIS.

In the context of the OP, this is appropriate because if their ISP offers mySQL and PHP, it’s likely they’re running it on Apache and Linux. However, this does not require the user to install a linux box for development or to test development code on the live server. The OP could run a Windows box with Apache/PHP to test code and then deploy to the ISP’s server with little or no adjustment for the change in OS.

Just a short note to mention that IIS is part of the XP Professional installation - but isn’t enabled by default. So you could run IIS 6.0 from XP Pro at no additional cost if you want to setup a test environment.

Also, I’m pretty sure you can run php Win32 on an IIS 6.0 server - but it would probably be easier to run on an Apache, since more users are running it that way, it would be easier to get free fellow user technical support and whatnot.

Thanks for all the helpful comments.

I’m confused by the above statement about the host supporting Paradox. Assuming the host supports MySQL, at that point it’s a matter of whether MySQL can read a Paradox database, no? Or are you suggesting that some web servers might have alternative software, like MySQL, but that can deal with a Paradox database?

Does Paradox being ODBC compliant make any difference to the situation?

Other people have some good material below but I think an overview of what a webserver is and isn’t might be benificial here.

The webserver’s basic job is to take requests from the client application (generally a web browser) over the internet and return information (generally HTML) to the client application.

The information returned is generally divided into two types, static and dynamic.

Static web pages are generally basic HTML files, you put in the address and the same thing pops up for every visit and for every visitor. In order to serve this content the web server merely has to read and regurgitate files from it’s hard drive (this is a simplification, commonly used files being cached in memory and a whole host of other tricks for speed are employed)

Dynamic content is when the webserver has to change the contents of the page on the fly (based on parameters passed to it for example). There are many methods of doing this, ASP, JSP, PHP, CGI etc etc. Part of the process may involve communication with other processes (databases for example).The problems for the webserver are an order of magnitude greater than serving static content.

As to why apache was reccomended, it’s a free and stable product that provides a great platform that can scale right up from learning on your own machine up to running some very big web sites indeed.

As to your current web host, there is no guarentee that they will serve dynamic content (there are security risks), that they will support the method of creating dynamic content you would like to use or that they will run any particular database product (paradox, MySQL etc). You will have to contact the hosting company to discover what features are available. In the meantime you can install apache (or it’s relative, tomcat) on your own machine and learn a lot quite quickly

If your web host runs a paradox database then you won’t have to do any conversion to MySQL, if you do have to do conversion then yes, ODBC (or similar ideas like JDBC) will be the way that you do this. If it proves to be necessary ask again and a few pointers can be given. Please note also that it would generally not be possible to host the database on your machine locally and still have a web hosting company run the site, you most likely will have to port at least a copy over to them. It is perfectly possible to run a system where database and web server are under completely seperate control but to be perfectly blunt I doubt this is an option with your current state of knowledge or that a web hosting company will agree to it. Once again I recommend that you talk to your web hosting company.

A) Find a web hosting company that can satisfy your needs.

B) Purchase a direct connection to the internet that is capable of handling the traffic your website generates (plus extra for safety), a decent server box and host the web site and whatever database products you want on it.

C) You may be able to find a company offering server rental rather than just plain old web hosting.

A is faster and probably cheaper in the short/medium term
B is more intellectually satisfying, long term cheaper and obviously gives you far more control. C is a decent hybrid of A and B.