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

  • Home
  • SEARCH
  • 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 1036845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:46:14+00:00 2026-05-16T14:46:14+00:00

I am using Zend_Db with the Pdo_Mysql driver. This query does not give any

  • 0

I am using Zend_Db with the Pdo_Mysql driver. This query does not give any results:

$s = $db->prepare('SELECT ET.id
                    FROM elementTypes AS ET, language AS L1 
                    WHERE L1.strId = ET.dispName AND L1.language = ?');
$s->execute(array(2));                                          
pr($s->fetchAll());

If I hardcode the parameter, the expected rows are returned.

What is going on here?

Edit: Here’s a stripped down script with even simpler queries: http://pastebin.com/84UtcGGZ

Eidt 2: I have drilled further down and found that the problem lies with PDO and comparing ENUMS with ints. See this question: PDO cannot compare mysql ENUM using integers in prepared statements
If you know any fixes/workarounds on how to get this to work on Zend_Db, please post! :)**

  • 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-05-16T14:46:15+00:00Added an answer on May 16, 2026 at 2:46 pm

    The reason why the statement does not work is that L1.language is an ENUM, and you cannot compare ENUMS with integers in Zend_Db / PDO.

    Why, and how to avoid this is explaied in this question: PDO cannot compare mysql ENUM using integers in prepared statements

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

Sidebar

Related Questions

Does using prepared statements in Zend_DB or Doctrine protect me from sql injection? example:
This is my SQL: SELECT `tbl`.*, 123 AS `test` FROM `tbl` GROUP BY `test`
does anyone know if you can get individual field comments from mysql using Zend
Using Zend_Form, how would I create form elements like this: <input type=text name=element[1] value=
This is my first experience using the Zend Framework. I am attempting to follow
This is my first time using Zend Framework for an application and i don't
Is there a best practice in getting data from multiple database tables using Zend?
I am attempting to pull some information from my tnsnames file using regex. I
I'm using Zend_DB and trying to change the charset to utf8, here is the
What is the easiest, simplest way to select the max of a column from

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.