Download PHP and MySQL - La Salle University

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Microsoft Access wikipedia , lookup

Serializability wikipedia , lookup

IMDb wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Oracle Database wikipedia , lookup

Functional Database Model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Ingres (database) wikipedia , lookup

Concurrency control wikipedia , lookup

SQL wikipedia , lookup

Database wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Versant Object Database wikipedia , lookup

Open Database Connectivity wikipedia , lookup

PL/SQL wikipedia , lookup

ContactPoint wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
PHP and MySQL
Get data from the Northwind Product
table and displaying it using PHP
Have a PHP page, start the table in
HTML, then start a PHP section
Set up PHP variables to connect to database.
-Since the page and database are both on the gamma
the $host variable is set to localhost
-The other variables are the MySQL username and
password and the name of your database
Use the mysql_connect method to connect to
MySQL.
Remember page and MySQL database are both
on gamma.
The die method writes a messages and quits –
used if something goes wrong.
Use the mysql_select_db method
to choose your database.
It’s case sensitive!
The $sql variable is set to an SQL
query. You can cheat here and let
PHPMyAdmin generate the PHP code
for you.
$i is for counting
The while loop processes the records from the query
The individual fields resulting from the query are
accessed using the variable $row[] – the first field has
an index 0, etc.