SQL i internet PHP i MySQL
Programy MySQL: serverMySQL: server WWW serverWWW server Interpreter PHPInterpreter PHP Przeglądarka stron wwwPrzeglądarka stron www
Programy MySQL MySQL 5.0Windows (x86) M Windows (x86) M MySQL Administrator Windows (x86) M Administrator Windows (x86) M MySQL Querry Browser (x86) M Querry Browser (x86) M
Serwer www Apache apache_ win32-x86-src.msi Microsoft Internet Information Server (IIS), Win 2000, Win XP Microsoft Personal Web Server (PWS) Win98 Xitami.
PHP PHP ( współpracuje z MYSQL nt) Non-windows: Complete Source Code PHP (tar.bz2) [6,207Kb] - 04 May 2006 PHP (tar.gz) [7,920Kb] - 04 May 2006 Windows BinariesPHP (tar.bz2) PHP (tar.gz) PHP zip package [8,919Kb] - 04 May 2006 md5: bf208201a671fd20a13490dc6f38b344PHP zip package Collection of PECL modules for PHP [2,227Kb] - 04 May 2006 md5: ff5ac6c4db975bc3ff2f3a89b7881c3fCollection of PECL modules for PHP PHP 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 installer
PHP
doc_root = c:\inetpub\wwwroot // for IIS/PWS NameDefaultChangeableChangelog mysqli.max_links"-1"PHP_INI_SYSTEMAvailable since PHP mysqli.default_port"3306"PHP_INI_ALLAvailable since PHP mysqli.default_socketNULLPHP_INI_ALLAvailable since PHP mysqli.default_hostNULLPHP_INI_ALLAvailable since PHP mysqli.default_userNULLPHP_INI_ALLAvailable since PHP mysqli.default_pwNULLPHP_INI_ALLAvailable since PHP Konfiguracja PHP i 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 NameDefaultChangeableChangelog mysqli.max_links"-1"PHP_INI_SYSTEMAvailable since PHP mysqli.default_port"3306"PHP_INI_ALLAvailable since PHP mysqli.default_socketNULLPHP_INI_ALLAvailable since PHP mysqli.default_hostNULLPHP_INI_ALLAvailable since PHP mysqli.default_userNULLPHP_INI_ALLAvailable since PHP mysqli.default_pwNULLPHP_INI_ALLAvailable since PHP Konfiguracja MySQLi (bo to wersja PHP v 5 i MySQL v5
PHP
PHP – Hello.php Test PHP <?php echo " Witaj na zajęciach POPOQ ! "; ?>
PHP
PHP -> HTML Test PHP <?php echo " Witaj na zajęciach POPOQ ! "; ?> Test PHP Witaj na zajęciach POPOQ !
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(); }
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); }
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); }
SQL i internet cd 3 /* Wysyłanie zapytania SQL */ $query = "SELECT * FROM przedmioty"; $result = mysqli_query ($link, $query) or die ("Zapytanie zakończone niepowodzeniem");
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";
PHP cd5: finał print " \n"; mysqli_close($link); ?>
PHP i MySQL