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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:30:52+00:00 2026-06-17T23:30:52+00:00

Im trying to delete record from database depending where conditions. The query is pretty

  • 0

Im trying to delete record from database depending where conditions. The query is pretty simple, but still Im getting strange results. What Im trying to do in ZF:

$where = array(
               $db->quoteInto('name = ?', $name),
               $db->quoteInto('surname = ?', $surname)
         );

$db->delete('users', $where);

While trying to debug Im getting:

DELETE FROM `users` WHERE (name = 'John') AND (surname = 'Johnson')

What is correct and working SQL statement. But later my values are getting stripped, so Im getting query like this:

DELETE FROM `users` WHERE (name = ) AND (surname = )

Depending debug results this happens in Zend_Db_Statement class (Statement.php), _stripQuoted method.

So finally as a result instead of one record deleted Im getting whole table cleared.

I’ve red the documentation and also Google’d for examples which are pretty much close to my situation. So Im not getting what is wrong with that?

Zend Framework version: 1.12

Any ideas?

  • 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-17T23:30:53+00:00Added an answer on June 17, 2026 at 11:30 pm

    The second parameter for delete should be a string. So I think you want:

    $where = $db->quoteInto('name = ?', $name).' AND '.$db->quoteInto('surname = ?', $surname);    
    $db->delete('users', $where);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting an error when trying to delete a record from the database.
I'm trying to delete specific record from database by row key. But when I
I am trying to delete the all record from the table in database, but
I'm trying to query a SQL database from vbs but when no record is
I was trying to delete a record from a table in AS/400 database. I
I am trying to delete a record from a database using the following code
Im trying to delete one record from the database using LINQ. i have given
Using PHP, I am trying to delete a record, but I want to check
I am trying to do a simple deletion of a record in the database.
im trying to do delete records from multiple database tables. For error handling i'm

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.