我在检索结果时遇到了小麻烦,希望有人可以帮助我。
我有一个名为 $incategory 的字段,它是一个基于逗号的字符串,我想要做的是将其分解为一个可用于检索结果的数组,如下所示(希望这是有道理的):
<?php
$showlist = $row_listelements['incategory'];
// ** e.g. $incategory = 1,3,5,
// ** What I want to do is look at table 'category'
// ** and retrieve results with an 'id' of either 1, 3 or 5
// ** Display Results
mysql_select_db($database_db, $db);
$query_display = "SELECT * FROM category WHERE id = ".$showlist." ORDER BY name ASC";
$display = mysql_query($query_display, $db) or die(mysql_error());
$row_display = mysql_fetch_assoc($display);
$totalRows_display = mysql_num_rows($display);
?>