Pobierz prezentację
Pobieranie prezentacji. Proszę czekać
OpublikowałŁucjusz Warszewski Został zmieniony 11 lat temu
1
SQL i internet PHP i MySQL
2
Programy MySQL: serverMySQL: server WWW serverWWW server Interpreter PHPInterpreter PHP Przeglądarka stron wwwPrzeglądarka stron www
3
Programy MySQL MySQL 5.0Windows (x86) 5.0.22 36.7M http://www.mysql.com/MySQL 5.0 Windows (x86) 5.0.22 36.7M http://www.mysql.com/ http://www.mysql.com/ MySQL Administrator Windows (x86)1.1.95.0M http://www.mysql.com/MySQL Administrator Windows (x86)1.1.95.0M http://www.mysql.com/ http://www.mysql.com/ MySQL Querry Browser (x86)1.1.205.1M http://www.mysql.com/MySQL Querry Browser (x86)1.1.205.1M http://www.mysql.com/ http://www.mysql.com/
4
Serwer www Apache apache_1.3.35-win32-x86-src.msi www.apache.org www.apache.org Microsoft Internet Information Server (IIS), Win 2000, Win XP www.microsoft.com www.microsoft.com Microsoft Personal Web Server (PWS) Win98 Xitami.
5
PHP 5.1.4 http://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 2006 PHP 5.1.4 (tar.gz) [7,920Kb] - 04 May 2006 Windows BinariesPHP 5.1.4 (tar.bz2) PHP 5.1.4 (tar.gz) PHP 5.1.4 zip package [8,919Kb] - 04 May 2006 md5: bf208201a671fd20a13490dc6f38b344PHP 5.1.4 zip package Collection of PECL modules for PHP 5.1.4 [2,227Kb] - 04 May 2006 md5: ff5ac6c4db975bc3ff2f3a89b7881c3fCollection of PECL modules for PHP 5.1.4 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: 86d83c9f42e281c60a40cf7c6d66db8dPHP 5.1.4 installer
6
PHP
7
doc_root = c:\inetpub\wwwroot // for IIS/PWS NameDefaultChangeableChangelog mysqli.max_links"-1"PHP_INI_SYSTEMAvailable since PHP 5.0.0. mysqli.default_port"3306"PHP_INI_ALLAvailable since PHP 5.0.0. mysqli.default_socketNULLPHP_INI_ALLAvailable since PHP 5.0.0. mysqli.default_hostNULLPHP_INI_ALLAvailable since PHP 5.0.0. mysqli.default_userNULLPHP_INI_ALLAvailable since PHP 5.0.0. mysqli.default_pwNULLPHP_INI_ALLAvailable since PHP 5.0.0. Konfiguracja PHP i MySQLi (bo to wersja PHP v 5 i MySQL v5
8
Runtime Configuration The behaviour of these functions is affected by settings in php.ini. Table 158. MySQLi Configuration Options NameDefaultChangeableChangelog mysqli.max_links"-1"PHP_INI_SYSTEMAvailable since PHP 5.0.0. mysqli.default_port"3306"PHP_INI_ALLAvailable since PHP 5.0.0. mysqli.default_socketNULLPHP_INI_ALLAvailable since PHP 5.0.0. mysqli.default_hostNULLPHP_INI_ALLAvailable since PHP 5.0.0. mysqli.default_userNULLPHP_INI_ALLAvailable since PHP 5.0.0. mysqli.default_pwNULLPHP_INI_ALLAvailable since PHP 5.0.0. Konfiguracja MySQLi (bo to wersja PHP v 5 i MySQL v5
10
PHP
11
PHP – Hello.php Test PHP <?php echo " Witaj na zajęciach POPOQ ! "; ?>
12
PHP
13
PHP -> HTML Test PHP <?php echo " Witaj na zajęciach POPOQ ! "; ?> Test PHP Witaj na zajęciach POPOQ !
14
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(); }
15
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); }
16
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); }
17
SQL i internet cd 3 /* Wysyłanie zapytania SQL */ $query = "SELECT * FROM przedmioty"; $result = mysqli_query ($link, $query) or die ("Zapytanie zakończone niepowodzeniem");
18
PHP cd4 /* Wyświetlenie wyników w HTML */ print " \n"; while ($line = mysqli_fetch_array($result, MYSQLI_ASSOC)) { print "\t \n"; foreach ($line as $col_value) { print "\t\t $col_value \n"; } print "\t \n"; } print " \n";
19
PHP cd5: finał print " \n"; mysqli_close($link); ?>
20
PHP i MySQL
Podobne prezentacje
© 2024 SlidePlayer.pl Inc.
All rights reserved.