1 / 20

SQL i internet

SQL i internet. PHP i MySQL. Programy. MySQL: server WWW server Interpreter PHP Przeglądarka stron www. Programy MySQL. MySQL 5.0 Windows (x86) 5.0.22 36.7M http://www.mysql.com/ MySQL Administrator Windows (x86)1.1.95.0M http://www.mysql.com/

alden
Télécharger la présentation

SQL i internet

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SQL i internet PHP i MySQL

  2. Programy • MySQL: server • WWW server • Interpreter PHP • Przeglądarka stron www

  3. ProgramyMySQL • MySQL 5.0Windows (x86) 5.0.22 36.7Mhttp://www.mysql.com/ • MySQL Administrator Windows (x86)1.1.95.0M http://www.mysql.com/ • MySQL Querry Browser (x86)1.1.205.1M http://www.mysql.com/

  4. Serwer www • Apache apache_1.3.35-win32-x86-src.msi www.apache.org • Microsoft Internet Information Server (IIS), Win 2000, Win XP www.microsoft.com • Microsoft Personal Web Server (PWS) Win98 • Xitami.

  5. PHP 5.1.4http://www.php.net/ • PHP 5.1.4 ( współpracuje z MYSQL 5.0.18.nt) • Non-windows: Complete Source Code • PHP 5.1.4 (tar.bz2) [6,207Kb] - 04 May 2006PHP 5.1.4 (tar.gz) [7,920Kb] - 04 May 2006Windows Binaries • PHP 5.1.4 zip package [8,919Kb] - 04 May 2006md5: bf208201a671fd20a13490dc6f38b344 • Collection of PECL modules for PHP 5.1.4 [2,227Kb] - 04 May 2006md5: ff5ac6c4db975bc3ff2f3a89b7881c3f • PHP 5.1.4 installer [2,639Kb] - 04 May 2006(CGI only, packaged as Windows installer to install and configure PHP, and automatically configure IIS, PWS and Xitami, with manual configuration for other servers. No external extensions included, get them from the zip and PECL downloads above, and install manually)md5: 86d83c9f42e281c60a40cf7c6d66db8d

  6. PHP

  7. Konfiguracja PHP i MySQLi (bo to wersja PHP v 5 i MySQL v5 doc_root = c:\inetpub\wwwroot // for IIS/PWS

  8. Konfiguracja MySQLi (bo to wersja PHP v 5 i MySQL v5 Runtime Configuration The behaviour of these functions is affected by settings in php.ini. Table 158. MySQLi Configuration Options

  9. PHP

  10. PHP – Hello.php <html> <head> <title>Test PHP</title> </head> <body> <?php echo "<p>Witaj na zajęciach POPOQ !</p>"; ?> </body> </html>

  11. PHP

  12. PHP -> HTML <html> <head> <title>Test PHP</title> </head> <body> <?php echo "<p>Witaj na zajęciach POPOQ !</p>"; ?> </body> </html> <html> <head> <title>Test PHP</title> </head> <body> <p>Witaj na zajęciach POPOQ !</p> </body> </html>

  13. SQL i internet :MySQL.PHP <?php ////$link = mysql_connect(„serwer", "uzytkownik", "haslo”,” baza”) printf ("Nowy przyklad"); $link = mysqli_connect("hefajstos", "popoq", "popoq", "popoq"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); }

  14. SQL i internet cd.1 • /* return name of current default database */ • if ($result = mysqli_query($link, "SELECT DATABASE()")) • { • $row = mysqli_fetch_row($result); • printf("Default database is %s.\n", $row[0]); • mysqli_free_result($result); • }

  15. SQL i internet cd2 • /* change db to „popoq” db */ • mysqli_select_db($link, "popoq"); • /* return name of current default database */ • if ($result = mysqli_query($link, "SELECT DATABASE()")) • { • $row = mysqli_fetch_row($result); • printf("Default database is %s.\n", $row[0]); • mysqli_free_result($result); • }

  16. SQL i internet cd 3 • /* Wysyłanie zapytania SQL */ • $query = "SELECT * FROM przedmioty"; • $result = mysqli_query ($link, $query) • or die ("Zapytanie zakończone niepowodzeniem");

  17. PHP cd4 • /* Wyświetlenie wyników w HTML */ • print "<HTML>\n"; • print "<BODY>\n"; • print "<table>\n"; • while ($line = mysqli_fetch_array($result, MYSQLI_ASSOC)) • { • print "\t<tr>\n"; • foreach ($line as $col_value) • { • print "\t\t<td>$col_value</td>\n"; • } • print "\t</tr>\n"; • } • print "</table>\n";

  18. PHP cd5: finał • print "</BODY>\n"; • print "</HTML>\n"; • mysqli_close($link); • ?>

  19. PHP i MySQL

More Related