Hi,
I am displaying list of jobs that are posted by admin from mysql db.
In that Table I used requisition_id (job id) , and the datatype is varchar(255), if we click
the job id , it will show the description .
My problem is, if it more than one digit, it showing nothing. If it is in one digit, it will show the particular job description.How to do?

Dani AI

Generated

Summary of the issue and likely causes (based on , and ): the symptom — single-digit requisition_id values work but multi-digit ones return nothing — most often comes from the id being truncated or mis-parsed before the database query, a mismatch between how the id is generated and how it's read, or a client-side selector/id naming problem. ’s suggestion to inspect the HTML is correct, but add server-side visibility and a quick query test as well.

Quick diagnostics (no-frills):

  • Confirm the anchor actually carries the complete id by viewing source / DevTools and checking the full href value.
  • Confirm the description page receives the same full value (dump the GET value and enable errors).
  • Confirm the SQL actually matches the varchar value (quote/bind it) and that no substring/indexing is applied to the id.

Examples of robust output and checks:

<a href="job.php?id=<?php echo urlencode($row['requisition_id']); ?>">
  Job <?php echo htmlspecialchars($row['requisition_id']); ?>
</a>

On the target page, make the incoming value visible and enable errors:

error_reporting(E_ALL);
ini_set('display_errors',1);
var_dump($_GET['id']);

Use parameterized queries so varchar ids are matched exactly:

$stmt = $pdo->prepare('SELECT description FROM jobs WHERE requisition_id = :id');
$stmt->execute(['id' => $_GET['id']]);

Other common pitfalls to check:

  • Accidental string-indexing: code like $_GET['id'][0] or substr($_GET['id'],0,1) will keep only the first digit.
  • JavaScript/CSS selectors: HTML id attributes that are purely numeric can confuse selectors; prefer id="job-123" or data-id="123" and use those.
  • URL rewriting rules or route patterns that accept only a single digit.

This checklist covers the usual causes that produce the exact behavior described and complements the HTML inspection advised earlier.

Recommended Answers

All 4 Replies

How are you displaying these records? Are you using a web application?

Yes , in PHP , HTML5 I am displaying these records.

Maybe providing some relevant code will help.

Inspect the HTML element, from your browser, that contains the job id and see if it matches the one from the database.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.