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!