Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
How to display the description of the item without the 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!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!