我试图只显示文本记录的一部分。
+---+---------+------------------+-------+
|No.| File ID | File Desc. |Status |
+---+---------+------------------+-------+
|1 | 400/4 | 1 - Test 1 400/4 | |
+---+---------+------------------+-------+
|2 | 400/1 | 5 - Test 5 400/1 | |
+---+---------+------------------+-------+
我想要实现的是在文件Desc上仅在“-”之前显示文本。这样的专栏?
+---+---------+------------------+-------+
|No.| File ID | File Desc. |Status |
+---+---------+------------------+-------+
|1 | 400/4 | 1 | |
+---+---------+------------------+-------+
|2 | 400/1 | 5 | |
+---+---------+------------------+-------+
有可能吗?下面是用于显示该列的代码段。
<?php
$sql = "SELECT * FROM minit WHERE CONCAT(`file_id`) LIKE '%".$strKeyword."%'
AND CONCAT(`file_desc`) LIKE '%".$strKeyword2."%'
AND CONCAT(`minit_summ`) LIKE '%".$strKeyword3."%'";
$query = mysqli_query($dbConn,$sql);
while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
{
?>
<tr>
<td><div align="center"><?php echo $result["file_desc"];?></div></td>
</tr>
<?php
}
?>