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

133
Views
jquery o php si X es mayor que Y

Estoy creando un sitio web que muestra un crud básico que muestra Companyname, Stock, Minumum, Maximum.

Me gustaría mostrar una alerta o un mensaje en algún lugar si el Stock es mayor que el máximo. ¿Cómo podría hacer esto? Aquí está mi código de página de visualización.

 <table class="table"> <thead> <tr> <th>ID</th> <th>Company Name</th> <th>Stock</th> <th>Minumum</th> <th>Maximum</th> <th>Action</th> </tr> </thead> <tbody> <?php if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { ?> <tr> <td><?php echo $row['id']; ?></td> <td><?php echo $row['companyname']; ?></td> <td><?php echo $row['stock']; ?></td> <td><?php echo $row['minumum']; ?></td> <td><?php echo $row['maximum']; ?></td> <td><a class="btn btn-info" href="update1.php?id=<?php echo $row['id']; ?>">Edit</a>&nbsp;<a class="btn btn-danger" href="delete1.php?id=<?php echo $row['id']; ?>">Delete</a></td> </tr>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede poner un mensaje adicional en la columna Stock con una declaración if .

 <td><?php echo $row['stock']; ?></td>

con

 <td><?php echo $row['stock']; if ($row['stock'] > $row['maximum']) { echo " > maximum"; } ?></td>
about 4 years ago · Juan Pablo Isaza Report
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!