<form method="get" action="<?=$_SERVER['PHP_SELF']?>"> <input type="text" name="word" /> <input type="submit" value="Szukaj" /> </form> <?php $keyword = $_GET['word']; $sql = "SELECT title, article FROM tresc WHERE title LIKE $keyword OR article LIKE $keyword"; } } ?>
Po otworzeniu strony wyświetla się błąd:
"Notice: Undefined index: word in C:\xampp\htdocs\kurs\szukaj.php on line 15
Wyniki wyszukiwaniaYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR article LIKE' at line 1"
Po wpisaniu słowa które chcę wyszukać wyświetla się:
"Unknown column 'slowo' in 'where clause'"
W czym tkwi problem?