Forum Moderators: phranque

Message Too Old, No Replies

MySQL : Its a language. No wait, its a server!

Where does it fit in with PHP?

         

GrapefruiTgirl

2:17 pm on Aug 7, 2006 (gmt 0)

10+ Year Member



I hope this is ending up in the right forum.

I use Apache 2.0.59 as a testing server;
Also, I use PHP 4.3.2, and that works hand in hand with the Apache.
Also, I have MySQL Server 4.1
Heres the question: What is MySQL? Is it a Server, in the sense that Apache is a server? Or is it a scripting language, or a database engine?
Perhaps this seems a silly question, but I cannot seem to get my local site to go 'live' on/using MySQL as a testing server. I have both Apache and MySQL running, always I have the site running on Apache.
Yet all over the place, in forums and on tutorial sites, I see the expression "php/MySQL" , written as if they are either interchangeable, or are one and the same, or are a team.
So: Do I need/want both PHP and MySQL? Does Apache use/want MySQL? Or was downloading MySQL a waste of bandwidth? :)

PS- if the explanation to all this exists in this site, I will find it; I am in the process of trying to read the applicable forum threads from inception to present, but it will take a whle :)

Sasha

trillianjedi

2:28 pm on Aug 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Sasha,

MySQL is a database engine that runs as a server.

It is not a pre-requisite to Apache or PHP. You only want it if you want to run a database.

You'll see many references to PHP/MySQL simply because the two together are a widely adopted standard for building database driven dynamic websites.

TJ

GrapefruiTgirl

2:39 pm on Aug 7, 2006 (gmt 0)

10+ Year Member



Heya! Thanks for that input TrillianJ :) it pretty much clears up the issue for me..
Ok, so unless I am doing something with databases, I don't need MySQL. Cool then, as I think I am still a bit new to be getting into that just yet :) and am doing just fine so far using the Apache with the PHP.
A final question on the subj.: As the MySQL runs as a 'server' does this mean that IF I were to be using some databases or such things within my site which is running on Apache, the database pages and files would be hosted on the MySQL server, and these pages would be called via a URL, when necessary, FROM the Apache server, as though they were another website entirely?

I hope I've asked that clearly enough. Thaks again ;)
Sasha

jetboy

3:05 pm on Aug 7, 2006 (gmt 0)

10+ Year Member



This could make things a lot more confusing!

*If* you were to use a MySQL database, the PHP in your pages would get data from MySQL using the MySQL functions (www.php.net/mysql). You'd work with this data in a similar way to working with strings or arrays. Apache would serve these pages just like any other page.

Users will just see web pages served by Apache. Whether or not they contain data from MySQL, they'll all look the same. In this scenario, MySQL isn't accessible from the outside world. You need both PHP and Apache to deliver MySQL data to web users.

GrapefruiTgirl

3:12 pm on Aug 7, 2006 (gmt 0)

10+ Year Member



Righto! Ok, gotcha and understood ;)
Thank you Jetboy

Sasha!
GrapefruiTgirl