我希望 $description 是从 Description 列中提取的一串单词。然后我想检查字符串是否有 $searchterm(在这段代码之前定义的一个词)。
//3. (a)for each, (b) if search term is in the description column, put line into sorted table.
// a. number of rows in spreadsheet
$results = mysql_query("SELECT * FROM csv");
$num_rows = mysql_num_rows($results);
// b. check rows and put into sorted table
$i=1;
do
{
$i++;
$description = mysql_query("SELECT Description FROM csv");
if (strpos($description,$searchterm) !== false) {
echo $description . "<br><br>";
} // end if
} // end do
while ($i<=$num_rows);