Witam. Gdy chcę wykonać zapytanie sql wyświetlają mi się takie błędy:
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\PhpProject3\index.php on line 20
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs\PhpProject3\index.php on line 20Pomożecie mi się ich pozbyć?
<?php
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Logowanie</title>
</head>
<body bgcolor="teal">
<div style="font-family:Courier; font-size: xx-large; text-align: center">
<b><u>
Logowanie do bazy danych
<br><br />
<form action="logowanie.php" method="post">
<fieldset>
<div style="text-align: center">
<legend> Proszę wpisać dane</legend>
</div>
<fieldset />
<input type="text" name="login" maxlength="10" size="20">-login<br />
<input type="text" name="haslo" maxlength="10" size="20">-hasło<br />
<input type="submit" name="wyslij" value="Wyślij">
</form>
<?php
$host='localhost';
$baza='projekt';
if(isset($_POST['login'])&& isset($_POST['haslo'])) {
$login=$_POST['login'];
$haslo=$_POST['haslo'];
$sql_haslo=$haslo;
$sql_login=$login;
}
}
if(isset($_POST['wyslij'])){ header('Location: index.php'); }
?>
</div>
</body>
</html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Baza danych</title>
<body>
<div style="text-align: center">
<form action="index.php" method="post">
<input type="submit" name="wyswietl" value="Wyświetl wszystkich kandydatów"><br />
</form>
<form action="index.php" method="post">
<input type="submit" name="szukaj" value="Szukaj kandydata"><br />
</form>
</div>
</body>
</html>
<?php
if(isset($_POST['wyswietl'])) {
$sql='select * from kandydaci';
}
?>