[CODE]$array_explode = explode(‘,’, $array);
for($i=0;$i<count($array_explode);$i++) {
if(!empty($array_explode[$i])) {
$sql = “SELECT sana, suom FROM adjektiivit WHERE sana = ‘$array_explode[$i]'”;
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$sana = $row[“sana”];
$suom = $row[“suom”];
echo “<p><b>” . $sana . “</b> ” . $suom . “</p><br>”;
}
}
}
}
I have this kind of code. This code explodes a string. Then every word, which it has exploded from the string, should fetch a line from a mysql-table, but with my skills I don’t get it work. The first word from the string gets its line but the rest of the words don’t fetch anything. There is something wrong in the loop.