Piszę pewną stronę i mam w niej taki kod do łączenia się z bazą:
$zabepieczenie = new ZapisOdczyt(); $_POST = $zabepieczenie->Zapis($_POST); $dane = new mysqli($db['host'],$db['login'],$db['haslo'],$db['baza']); $dane->set_charset('utf8'); $sql = "select * from Uzytkownik where UZY_Login = '{$_POST['login']}';"; $dane_zapytanie = $dane->query($sql); $dane_pobrane = $dane_zapytanie->fetch_assoc(); //echo $haslo_md5; if($haslo_md5 == $dane_pobrane['UZY_Haslo']) { //$info = "Przenosimy"; $_SESSION['zalogowany'] = 'tak'; $_SESSION['login'] = $_POST['login']; } else { $info = "Podane dane są nieprawidłowe"; }
Mniejsza z tym o jego treść. Problem jest w tym, że na jednym komputerze wszystko działa a na drugim sypie takimi błędami:
Cytat
Warning: mysqli::mysqli() [mysqli.mysqli]: Premature end of data (mysqlnd_wireprotocol.c:554) in F:\xampp\htdocs\zespolowy\admin\index.php on line 9
Warning: mysqli::mysqli() [mysqli.mysqli]: OK packet 1 bytes shorter than expected in F:\xampp\htdocs\zespolowy\admin\index.php on line 9
Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in F:\xampp\htdocs\zespolowy\admin\index.php on line 9
Warning: mysqli::set_charset() [mysqli.set-charset]: Couldn't fetch mysqli in F:\xampp\htdocs\zespolowy\admin\index.php on line 10
Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli in F:\xampp\htdocs\zespolowy\admin\index.php on line 12
Fatal error: Call to a member function fetch_assoc() on a non-object in F:\xampp\htdocs\zespolowy\admin\index.php on line 13
Warning: mysqli::mysqli() [mysqli.mysqli]: OK packet 1 bytes shorter than expected in F:\xampp\htdocs\zespolowy\admin\index.php on line 9
Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in F:\xampp\htdocs\zespolowy\admin\index.php on line 9
Warning: mysqli::set_charset() [mysqli.set-charset]: Couldn't fetch mysqli in F:\xampp\htdocs\zespolowy\admin\index.php on line 10
Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli in F:\xampp\htdocs\zespolowy\admin\index.php on line 12
Fatal error: Call to a member function fetch_assoc() on a non-object in F:\xampp\htdocs\zespolowy\admin\index.php on line 13
Dane do łączenia się poprawne, bo tak jak mówię, na innych kompach wszystko działa, tylko na moim jest problem. Z innymi projektami nie mam problemu.