At 04:08 PM 1/14/2000 , pons@stripped wrote:
>Hi.
>My name is Giulio.
>I'm an italian student and i'm doin' a work to get my
>degree at university.
>I have to create a database on a webserver.
>I have php and mysql on the server (the administrator
>told me) so i've decided to use this technology to do the
>work.
>In my project i have to explain how php and mysql
>works on server but i'm not sure i've understood everything
>of what i read on the internet.
>so here i am.
>
>I know that this is the sequence of the actions:
>
>0) web-user requires a php page
>1) the webserver passes the request to the php
>2) php calls mysql to use database
>3) mysql executes the query
>4) mysql sends results to php
>5) php generate an html page
>6) php passes html page to the webserver
>7) the webserver send html to the user
>
>I've read on manual that "MySQL is a database server" that
>is to say that it is the entity which uses the database
>files directly. isn't it?
Yes...the database server is an entity which understands a query language -
usually some dialect of SQL - and searches the data tables for your
request, and returns the appropriate records. HOW the DB server stores the
records, WHERE it stores them, and how it indexes and searches them are its
business. If you aren't a DBA (database administrator) you can generally
consider the DB server to be a black box that accepts queries and returns
sets of records. A program like Microsoft Access combines a database
front-end (query generator, screen form design, etc) and report writer with
a back-end database engine (I think Microsoft calls it the "Jet engine",
but its performance is more in the propeller-driven class).
>Someone told me that ODBC is ALWAYS used when there is a
>database... but i'm not sure about it, i think that MySQL
>don't need ODBC to work.
>I'd like to know if ODBC is used in step 3.
No. ODBC (Open DataBase Connectivity, I think) is a 'standard' interface
between a calling program - say, in PHP - and a database - say, MySQL. It
is a 'least common denominator' approach which allows you to switch
database back-ends with a minimum of trouble. It is less efficient than the
native calls (in PHP: mysql_db_query(), mysql_insert_id(), etc.) and often
does not allow you to use the special features of a given database. It
should only be used (in my opinion, anyway) if you need to talk to a
database where a native interface is not available. For instance, querying
Microsoft Access from PHP. It can also be used as an abstraction layer,
isolating you from differences in SQL from database to database, but there
are other approaches to that. For instance, in PHP, you can use the PHPLIB
library's DB_SQL (I think) class.
- steve
+------------------------------------------------------------------------+
| Steve Edberg University of California, Davis |
| sbedberg@stripped http://aesric.ucdavis.edu/ |
| (530)754-9127 |
+---------------------- Gort, Klaatu barada nikto! ----------------------+