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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:33:50+00:00 2026-05-27T03:33:50+00:00

Hello, I am building queries with Kohana Query Builder, and I’m trying to get

  • 0

Hello, I am building queries with Kohana Query Builder, and I’m trying to get this kind of query:

UPDATE `report_count` SET `report_count`=  report_count + 1;

What i have right now is:

DB::update('report_count')->set(array('report_count' => 'report_count + 1'));

And it outputs this query:

UPDATE `report_count` SET `report_count` = 'report_count + 1'

So my problem is that it puts ' ' around report_count + 1. How can I remove these?

  • 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-27T03:33:51+00:00Added an answer on May 27, 2026 at 3:33 am

    You need to use an expression object. Kohana’s query builder lets you create expressions with DB::expr.

    The query builder will normally escape all its input, as you’d want it to, but text supplied as an expression object will be included in the query as-is.

    The example given in the documentation is basically your exact situation:

    $query = DB::update('users')->set(array('login_count' => DB::expr('`login_count` + 1')))->where('id', '=', $id);
    

    This generates a query like the following (the id value of 45 is just an example):

    UPDATE `users` SET `login_count` = `login_count` + 1 WHERE `id` = 45
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I know all about http://www.php.net/manual/en/function.http-build-query.php to do this however I have a little
Hello I am building a simple aggregator script and I am trying to have
Hello I am building a website using JSF 2.0. I am trying to set
When building a simple hello-world-style project trying to embed v8 I get an error
Hello everyone I am trying to resize an image of 700kb with imagecreatefromjpeg. This
I am building a service stack for the first time: hello world. I have
I'm searching a lucene index and I'm building search queries like field1:hello AND field2:world
Hello I am trying to make a little spider. While I was building it
Hello this is how I am building my own forum but this is how
Helo. I am building an application for kids using Phonegap. On Android 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.