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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:43:12+00:00 2026-05-27T04:43:12+00:00

I have a pretty weird problem related to zend framework’s zend_db. I use $this

  • 0

I have a pretty weird problem related to zend framework’s zend_db.

I use

$this -> update(array('visits' => new Zend_Db_Expr('`visits` + 1')), new Zend_Db_Expr("`ip` = '{$ip}' AND `day` = {$day} AND `month` = {$month} AND `year` = {$year}"));

to increments visits with 1. The problem is that Zend increments it with value * 2, in this case 2, if I say visits + 5, it then increments with 10?!!

It is really strange, since the pure SQL works. I’ve tried going to the code of the Update() function, then I just say exit($sql) and I can see that the SQL is ok, it runs properly under phpMyAdmin, except when I let update() run.

I thought I might call update() twice somewhere, so I’ve put exit(); in it, so it would break after running once… same problem…

Thanks in advance!

Btw, my zend framework is 1.11.11 or less.

  • 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-27T04:43:13+00:00Added an answer on May 27, 2026 at 4:43 am

    what happens if you write it as a standard sql update, without the zend_db_table’s update() function? does it work as expected ?

    $this->_db->query('UPDATE ' . $this->_name . ' SET visits = visits + 1 WHERE ip = ? AND `day` = ? AND `month` = ? AND `year` = ?", array($ip, $year, $month, $day);
    

    If it does work correctly, it means there’s something wrong with the update() function.
    If it’s still an issue, you might running the script twice somehow.

    Also, does your class extend directly from Zend_Db_Table_Abstract? I had some cases that the update function was override with a different logic.

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

Sidebar

Related Questions

This is pretty weird. I have my Profiler open and it obviously shows that
I have this weird problem where my Google Maps API script doesn't work, no
I have a pretty weird problem in my iPhone app which is, I think,
I've a weird problem with malloc. I have this typedefs: typedef struct buffer {
This is the second time that I have this really weird problem with WCF
this time, I'm facing a really weird problem. I've the following code: $xml =
I have a weird problem. I can only copy the text once. If I
Something pretty weird is happening with my app: I have the following property in
I have a rather small but weird problem that I can't seem to fix.
I got a VERY weird problem happening with ALL my DocumentCompleteEventHandlers. Say I have

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.