我只需要过滤以“250”开头的记录,而不是显示我的所有记录。有没有办法改变我现有的表格脚本只显示以“250”开头的记录?
<?php
$db = new mysqli("localhost", "XXXXXX", "XXXXXX", "naturan8_hero");
$query = "SELECT type, part_no, description, artwork, min, max, qty FROM cartons_current LIMIT 0,100";
$result = $db->query($query, MYSQLI_STORE_RESULT);
$o = '<table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1"><thead><tr><th>TP </th><th>Item Number </th><th>Description</th><th>Artwork No. </th><th class="hidden">PDF </th><th>Min </th><th>Max </th><th>Qty </th> </tr></thead><tbody>';
while(list($type, $part_no, $description, $artwork, $min, $max, $qty) = $result->fetch_row()) {
$o .= '<tr><td>'.$type.'</td><td class="ptn">'.$part_no.'</td><td>'.$description.'</td><td>'.$artwork.' </td><td class="hidden"><a href="/data/hero/upload/'.$part_no.'.pdf" target="_blank">Link </a></td><td align="right" class="min">'.$min.'</td><td align="right" class="max">'.$max.'</td><td align="right" class="quantity"> '.$qty.'</td></tr>';}
$o .= '</tbody></table>';
echo $o;
?>