如何在没有ID的情况下显示项目的描述
我的代码是这样的:
$conn = new mysqli($dbhost,$dbuser,$dbpass,$db) or die("Connect Failed: %s\\n". $conn-\>error);
$category=$_POST['category'];
if($category==1)
{
$RetStockPHP="SELECT id, CONCAT(imei,', ',brand,', ',model) AS Eqname FROM tbl_equipment";
if($res1=mysqli_query($conn,$RetStockPHP))
{
if(mysqli_num_rows($res1)>0)
{
while($row1=$res1->fetch_assoc())
{
$idPHP1=$row1['id'];
$EqnamePHP1=$row1['Eqname'];
echo "<option value='$idPHP1'>$EqnamePHP1</option>";
}
}
}
}
else
{
$RetStockPHP="select it.id as itemcode, concat(art.description,', ',it.description,', ',ut.description) as fitem , category from ref_item as it left join ref_article as art on it.article_id = art.id left join ref_unit as ut on it.unit = ut.id order by it.id;";
if($res1=mysqli_query($conn,$RetStockPHP))
{
if(mysqli_num_rows($res1)>0)
{
while($row1=$res1->fetch_assoc())
{
$ItemcodePHP1=$row1['itemcode'];
$fitemPHP1=$row1['fitem'];
echo "<option value='$ItemcodePHP1'>$fitemPHP1</option>";
}
}
}
}
耗材的结果如下:
2|圆珠笔,蓝色,2mm 笔尖,盒子
和设备的结果如下:
20220010201|IMEI-12345、ASUS、VIVOBOOK 14。
code>
如何不显示ID?
抱歉这里是新手。任何帮助将不胜感激!
My code is this:
$conn = new mysqli($dbhost,$dbuser,$dbpass,$db) or die("Connect Failed: %s\\n". $conn-\>error);
$category=$_POST['category'];
if($category==1)
{
$RetStockPHP="SELECT id, CONCAT(imei,', ',brand,', ',model) AS Eqname FROM tbl_equipment";
if($res1=mysqli_query($conn,$RetStockPHP))
{
if(mysqli_num_rows($res1)>0)
{
while($row1=$res1->fetch_assoc())
{
$idPHP1=$row1['id'];
$EqnamePHP1=$row1['Eqname'];
echo "<option value='$idPHP1'>$EqnamePHP1</option>";
}
}
}
}
else
{
$RetStockPHP="select it.id as itemcode, concat(art.description,', ',it.description,', ',ut.description) as fitem , category from ref_item as it left join ref_article as art on it.article_id = art.id left join ref_unit as ut on it.unit = ut.id order by it.id;";
if($res1=mysqli_query($conn,$RetStockPHP))
{
if(mysqli_num_rows($res1)>0)
{
while($row1=$res1->fetch_assoc())
{
$ItemcodePHP1=$row1['itemcode'];
$fitemPHP1=$row1['fitem'];
echo "<option value='$ItemcodePHP1'>$fitemPHP1</option>";
}
}
}
}
The result is like this for Supplies:
2|Ballpen, blue, 2mm tip, box
and for equipment:
20220010201|IMEI-12345, ASUS, VIVOBOOK 14.
How do I not display the ID?
Sorry Newbie here. Any help would be much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论