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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:00:51+00:00 2026-06-04T10:00:51+00:00

Possible Duplicate: How do I add a limit to update-query in Zend Framework? I

  • 0

Possible Duplicate:
How do I add a limit to update-query in Zend Framework?

I would like to do a update and place LIMIT 1 as precaution.
Here is my code:

$vals = array();
$vals['status'] = 'closed';
$where = $write->quoteInto('id =?', $orderID);

$write->update("order", $vals ,$where);

Where can i add a LIMIT into this query?

(looks like has been asked in the past but i hope someone out there has the answer)

  • 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-04T10:00:53+00:00Added an answer on June 4, 2026 at 10:00 am

    It looks like you’re using Zend_Db_Adapter to perform your queries so I’m not sure you can do what I do, anyway here goes.
    I usually use the Zend_Db_Table_Row save() method to insert and update records, however I also use the DbTable models to provide access to the Table and Table_Row abstract api’s.

    public function save(Music_Model_Artist $artist) {
            //if id is not null
            if (!is_null($artist->id)) {
                //find row, uses fetchRow() so will return NULL if not found
                $row = $this->findById($artist->id);
                $row->id = $artist->id;
            } else {
                //if ID is null create new row
                $row = $this->_getGateway()->createRow();
            }
            //assign data to row
            $row->name = $artist->name;
            //save new row or update
            $row->save();
            //return the row, in case I need it for something else
            return $row;
        }
    

    what this amounts to is that if I include and ID in the data array (or in this case an entity object) the row will be updated and if there is no ID in the object a new row will be created.

    If your curious here’s how I __construct the class:

    public function __construct(Zend_Db_Table_Abstract $tableGateway = NULL) {
            //pass in concrete DbTable Model, parent alts to using table name string to construct class
            $this->_tableGateway = new Application_Model_DbTable_Artist();
            parent::__construct($tableGateway);
        }
    

    Hope this provides some help.

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

Sidebar

Related Questions

Possible Duplicate: Confusing add command in x86 assembly I would like to understand these
Possible Duplicate: How do I add a class to a given element? I'd like
Possible Duplicate: Dynamically adding collapsible elements I would like to know how I could
Possible Duplicate: rename multiple files at once in unix I would like to rename
Possible Duplicate: Add timestamps in python dates = {} dates.update({'2011-03-07':'16:03:01'}) dates.update({'2011-03-06':'16:03:01'}) dates.update({'2011-03-08':'16:03:01'}) dates.update({'2011-03-04':'16:03:01'}) dates.update({'2011-05-16':'16:03:01'})
Possible Duplicate: How to add days to a date in Java I need to
Possible Duplicate: Any way to add HttpHandler programatically in .NET? Is there a way
Possible Duplicate: What do I have to add to a layout to hide the
Possible Duplicate: How does one add additional items to NSMenu in Interface Builder? There's
Possible Duplicate: array_splice() for associative arrays How to add an array value to 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.