Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9085783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:19:42+00:00 2026-06-16T21:19:42+00:00

I have page with a hyper link on it like so : When clicking

  • 0

I have page with a hyper link on it like so :

preview

When clicking on the A0000000 it will redirect you to localhost/student.php?anum=A00000000

I have checked if the actual number was being passed using

$get = $_GET['anum'];
echo $get;

this is what I get : Preview

I have done this multiple times before but the one thing that has changed is that now I am using a inner join and WHERE clauses to make a specific search. What this search must do is :

  1. List a student that has counselorname as NOT NULL
  2. Where finished= 1
  3. And where the anum or student id number is = to the url anum using $_GET[‘anum’]

this is the select statement :

$anum = filter_input(INPUT_GET, 'anum', FILTER_SANITIZE_STRING);
$anum = filter_var($anum, FILTER_SANITIZE_NUMBER_INT);

    try 
    {
    $query = $dbh->prepare("SELECT * FROM inoffice INNER JOIN comments ON 
                            inoffice.id = comments.id WHERE counselorname 
                            IS NOT NULL AND finished = '1' AND anum = :anum ");
    $query->bindParam(':anum', $anum);
    $query->execute();
    $result = $query->fetchall();
    }
        catch (PDOException $e) {
        error_log($e->getMessage());
        die($e->getMessage());
        }

I have tried the same query just by putting anum = A0000000 and it works flawlessly.

but when i try to do the above code i get an empty echo’d table.

Any help would be awesome! – ty

EDIT 1 : Thank you to cryptic remove the sanitizing part of the code the filter and what not and all works well. That was removing the A from the actual number part. So the query was not passing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:19:43+00:00Added an answer on June 16, 2026 at 9:19 pm
    $anum = filter_var($anum, FILTER_SANITIZE_NUMBER_INT);
    

    is stripping out the letter 'A'

    Per the documentation:

    FILTER_SANITIZE_NUMBER_INT – Remove all characters except digits, plus and minus sign.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have page named page--news.tpl.php, which i created for my news page. But after
I have page, i can contact directly without any problems. http://www.mysite.com/app_dev.php/comments/22 the page shows
I would like to have a page that would contain: hyperlik Add new country.
I have defined file path like- $docRoot = $_SERVER['DOCUMENT_ROOT']; $webRoot = str_replace(array($docRoot, 'library/config.php'), '',
Say I have values on my page, like #100 #246, What I want to
I have a repeater which dynamically generate tab links using Sitecore (sc:Link) like this:
I have a hyperlink on my page and I would like it to automatically
In my page i have download links to files like Documents,Audio and Video and
Say I have a basic page like so: <custom:TableOfContents /> <h1>Some Heading</h1> <h2>Foo</h2> <p>Lorem
I have a page where I divided things like this: a div for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.