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

216
Views
Texto de salida si el valor SQL está vacío

Estoy tratando de generar el texto 'N/A' en mi tabla si hay un valor vacío almacenado en mi tabla SQL. Esto es lo que tengo hasta ahora:

 while($rowObj = $queryResult->fetch_object()) { $eventTitle = $rowObj->eventTitle; $catDesc = $rowObj->catDesc; $catID = $rowObj->catID; $eventDescription = $rowObj->eventDescription; $venueName = $rowObj->venueName; $venueID = $rowObj->venueID; $eventStartDate = $rowObj->eventStartDate; $eventEndDate = $rowObj->eventEndDate; $eventPrice = $rowObj->eventPrice; echo " <tr> <td> $eventTitle </td> <td> " . (empty($catID)) ? 'N/A' : '$catDesc'. "</td> <td> " . (empty($eventDescription)) ? 'N/A' : '$eventDescription'. "</td> <td> " . (empty($venueID)) ? 'N/A' : '$venueName'. "</td> <td> $eventStartDate </td> <td> $eventEndDate </td> <td> $eventPrice </td> </tr> "; }
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

if(empty($value)){ echo "This value is empty"; }

O si desea insertar un valor "en la tabla" si un campo está vacío

 if(empty($value)){ $value = "N/A"; //INSERT QUERY }
over 4 years ago · Santiago Trujillo Report

0

Prueba esto

$valor = vacío ($valor) ? "NA" : $valor;

over 4 years ago · Santiago Trujillo 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!