Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: Help With Warning Message Date: Mon, 23 Aug 2021 09:13:04 +0200 Lines: 28 Message-ID: References: <7no5igtt055jqdalqa2u2vlkfeu6bvhnag@4ax.com> <8ia6ig94heh1gjujblafvn17or10ufdlik@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 4hsi89RuCwKCflOduDj2iAvz6r7/mLfcI+fX0dkYRCaAs+sKrs Cancel-Lock: sha1:O8FrrN5Uy5WsH+ZKeTq1SfaRo48= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: <8ia6ig94heh1gjujblafvn17or10ufdlik@4ax.com> Content-Language: en-US-large Xref: csiph.com comp.lang.php:18774 On 23/08/2021 07.03, Call Me Tom wrote: > > $da_name = $da['airport_name']; is line 104. When I Access $da_name > in my table, it prints the airport name. Can you tell what it thinks > is a boolean? The $da is boolean for the row before failed: $da = $result4->FETCH(PDO::FETCH_ASSOC); So you should check the $da value before using it if($da) { $da = $result4->FETCH(PDO::FETCH_ASSOC); $da_name = $da['airport_name']; } else { // do what you need to tell it didn't find any thing } also worth mentioning, the variable $origin needs to be sanitized, as it's a prone for SQL-injection. I do suggest you use withe list method, where you check that the string has only allowed characters. -- //Aho