0
$szukaj_slowo = 'SELECT * FROM slowa WHERE slowo='.$slowo.'';
$wyslij_zapytanie = $connect->query($szukaj_slowo);
$pobierz_wartosc = $wyslij_zapytanie->fetch_assoc();
$szukaj_slowo_wynik = $pobierz_wartosc['slowo'];
    $connect->close(); 
    if( $szukaj_slowo_wynik == NULL || $szukaj_slowo_wynik == "" )
    {
        Header('Location: index.php');
    }

I take $slowo from form, but if $slowo is empty then i got a fatal error

Fatal error: Call to a member function fetch_assoc() on boolean in C:\xampp\htdocs\error_spr\wyszukaj.php on line 16
7
  • can you show what link is line 16? Commented Mar 13, 2016 at 2:53
  • $pobierz_wartosc = $wyslij_zapytanie->fetch_assoc(); Commented Mar 13, 2016 at 2:54
  • you could use a while loop that would be better Commented Mar 13, 2016 at 2:55
  • Can you give me example? Commented Mar 13, 2016 at 2:56
  • @Vento i have posted a answer look at it and try that exact code Commented Mar 13, 2016 at 2:57

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.