PHP에서 mysql varchar로 단어를 어떻게 비교할 수 있습니까?
이 코드는 내가 원하는 무엇을 생산하지만,이 오류를PHP - 분해 된 단어를 PHP의 mysql varchar와 비교하십시오.
veranderenwachtwoordjij
치명적인 오류 제공 : 비 객체의 멤버 함수 fetch_assoc()를 호출합니다 ......
$word = "Also, to be safe, change your password regularly... you don't have to be obsessive about it: every three hours or so should be enough. And because erring on the side of caution is always a good idea, fake your own suicide and change your identity at least once a year.";
$pieces = explode(" ", $word);
$x = 0;
while($x < word_count($word)) { // word count function returns int (51)
$aPiece = $pieces[$x]; // change $pieces[$x] to 'you' and then it works
$result = $conn->query("SELECT * FROM dict WHERE english='$aPiece'");
$z = 0;
while($z < $num_result) // $num_result returns amount of rows in database
{
$row = $result->fetch_assoc(); //error line is here
echo stripslashes($row['dutch']);
$z++;
}
$x++;
}
나는 PHP를 한 지 오래되었습니다. 그들은'for'-loop를 비난 했습니까? – Johnsyweb