what exactly does mysql do?

what up,
what exactly is mysql? is it free for download? like i know how to do html, and all you need is a webhost, for example freewebs.com. and you upload ur .html pages onto there. can you do the samething on a webhost with .php files? if so… where does mysql come in? thanks to anyone who responds :)

warm regards

PHP is a server side running programming. That is why when you go to someones site who is using PHP and View Source you see nothing but html. When you program something in PHP you have to have software installed on the server where you site will be hosted before it will even do anything. Think of it like this when someone calls up your php this is what happens with it:

When a page is requested by a web surfer, the page is first ran through the PHP Paser on the server. Then it is sent down to the client after it has been parsed into HTML.

PhpCode.php --> PHP Parser converted to HTML --> Client

Thats why when you write php code you need to began any PHP code with <? and end it with ?>. This is how the parser knows when to start parsing and when to just ignore the code. Let say below is a php page in which you are coding.
PHP CODE EXAMPLE______
Code:

EXAMPLE [php]<? echo "This is my php code!!"; echo "
This is a single rowed, single celled table!
"; for($i=0; $i == 5 ; $i++) { echo $i . "
"; } ?>[/php] Code:

Then when the page is called through the web browser and if you were to View Source this is what you would see___

Code:

<HTML> 
<HEAD><TITLE></TITLE></HEAD> 
<BODY> 
This is my php code!! 
<TABLE><TR><TD>This is a single rowed, single celled table!</TD></TD></TABLE> 
1<BR> 
2<BR> 
3<BR> 
4<BR> 
5<BR> 
</BODY> 
</HTML> 

MySQL is a type of SQL database management. To make a site dynamic you need to be able to store information. You use MySQL to do this. You use MySQL to orginize the content of your site. If you had a table in your database that was used to keep address and you had the fields
ID City State… Through PHP and MySQL you can output to a page all the Citys Under a certian state or ID. Or a Certain state associated with a id…and so and so forth.

Hope that helps clearify things for you.

hello,
thank you for responding to my topic. :D what you said here really helped me understand actually how php works -> “PhpCode.php --> PHP Parser converted to HTML --> Client”
but what tool do you need to make sure the php parser is converted to html? how does php get converted to html? or does your web host domain automaticaly do that when you upload ‘mypage.php’?

regarding mysql,
so the database server is not a nececity for a typical php website? you only need it if you have fill-out forms, or like a member login?

thanks for all of your help!
warm regards

parser
definition (kind of :) ) - a program that takes individual lines of PHP code (annotated with the semicolon) and breaks ithem down into something the machine can understand and do. Typically written in C or C++.

In order for a web site to use PHP the site must have the engine/parser loaded. (Easiest way to find out is to ask the hosting company… they will tell you a simple yes/no. If yes they may give you a version number.) The programmer doesn’t need anything other then a text editor to write the code (notepad, textpad for example) and a method of uploading the code to the site.

As for how the code gets parsed into HTML… you as a beginner really don’t need to know the details and would probably be very confused if we tried to explain… so just know that it works like a wonderful black box. Stick something in and out pops the correct stuff.

MySQL is one of those things that if you have never used it before will not miss (at least for relatively small sites), but once you use it will never wish to be without again (or at least without some kind of RDBM). Even forms and logins can be done without MySQL by means of flat files. I love MySQL - but then I also know databases and SQL. Whether or not it is a necessity for a web site is based on what the website will do. If it will store little information and not really be very dynamic or indiviualized for the user then it isn’t needed. (little information = less then a thousand records). So it will really depend on you and what your site will ultimately become.

thank you thank you all very much for helping me with my questions!!
manny thanks ^^

warm regards!!

thank you thank you all for helping me with my questions! all who responded. helped me learn more about php!! thank you all many thanks!! ^^

warm regards

my apology for doing a x2 post i did not realize my first one sent through i do know how to use the edit button :)

That code won’t loop ;)

for( $i = 0; 5 > $i; $i++ )

And it would list 0 to 4, not 1 to 5, but anyway, it’s quite far from the real question.

Sponsor our Newsletter | Privacy Policy | Terms of Service