<?php error_reporting(E_ALL); ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); $conn_server = "adres_serwera"; $conn_user = "login"; $conn_pass = "hasło"; $database = "nazwa_bazy_danych"; //mysql - do PHP 5.6 if (version_compare(phpversion(), '7.0', '<')) { echo "mysql:<br>"; $spojeni=mysql_connect($conn_server,$conn_user,$conn_pass); if (!$spojeni) { echo "Connection failed: " . mysql_error(); exit; } if (mysql_select_db($database)){ echo "Connected"; mysql_close(); } else echo "Connected, database name: " . mysql_error(); } //mysqli - od PHP wersja 7 else { echo "<br>mysqli:<br>"; $mysqli=new mysqli ($conn_server,$conn_user,$conn_pass,$database); if ($mysqli->connect_errno) { printf ("Connection failed: %s\n", $mysqli->connect_error); exit(); } else echo "Connected, server " . $mysqli->server_info; } ?>
Utworzony skrypt umieść w katalogu www. W celu przetestowania w przeglądarce wystarczy wpisać: http:/twoja_domena/mysql.php
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add st@forpsi.pl to your trusted senders list in your email software.