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 8474137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:32:43+00:00 2026-06-10T17:32:43+00:00

I am trying to execute this query using PDO: select * from users where

  • 0

I am trying to execute this query using PDO:

select * from users where uuid = 0x1e8ef774581c102cbcfef1ab81872213;

I pass this SQL query to the prepare method of PDO:

select * from users where uuid = :uuid

Then I pass this hashmap to execute:

Array ( [:uuid] => 0x1e8ef774581c102cbcfef1ab81872213 ) 

It looks like this query is being executed on the mysql server, when I call fetchAll:

select * from users where uuid = '0x1e8ef774581c102cbcfef1ab81872213';

How can I execute the query without having PDO add the quotes around my hex?

Thanks,
Steve

  • 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-10T17:32:45+00:00Added an answer on June 10, 2026 at 5:32 pm

    Your value HAS to be inserted as a string, as it’s far beyond (128bit) what can be represented as a normal number in PHP in both 64bit and 32bit editions.

    e.g. skip the placeholders and embed it into the query string directly:

    $uuid = '0x....';
    $sql = "SELECT ... WHERE uuid = $uuid";
    

    which means you lose the benefits of placeholders, and will have to deal with SQL injection mitigation directly.

    You don’t mention which DBMS you’re using, but you might be able to get around it by exploiting your DBMS’s casting functions, eg.

    SELECT... WHERE uuid = CAST(:uuid AS uuid_type)
    

    with this, even though it goes into the DB as a string, it’ll be treated as a native uuid when push comes to shove.

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

Sidebar

Related Questions

this is my first question. I'm trying to execute a SQL query in django
I am trying to execute a namedquery @NamedQuery(name=getEmployeeDetails,query=select e.username,e.email,e.image,e.firstname,e.lastname from Employee e where e.empid=?1)
Trying to make insert or update sql using the prepared statements from php's pdo.
I'm trying to execute this SQL command in the VS Query Builder: INSERT INTO
I am trying to execute this SQL query prior to restoring a .BAK file
I've been trying to execute this mysql query in my php file however I
I'm trying to execute a query with the Tornado's database wrapper , like this
I'm trying to execute this: $ mysql --user=XXX --password=XXX --batch --skip-column-names \ -e SELECT
I'm trying to execute this function when a select list's (LevelId0) value change but
I have a problem when trying to execute this update statement (below) using C#

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.