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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:58:30+00:00 2026-05-28T17:58:30+00:00

i am using cakephp and creating this condition: $conditions = array(Userword.levelid=>0, Userword.userid=>$this->Auth->user(‘UserId’),date(Userword.date)=>DATE_SUB(CURDATE(),INTERVAL 0 DAY));

  • 0

i am using cakephp and creating this condition:

$conditions = array("Userword.levelid"=>0, "Userword.userid"=>$this->Auth->user('UserId'),"date(Userword.date)"=>"DATE_SUB(CURDATE(),INTERVAL 0 DAY)");  
$Userword = $this->paginate(null, $conditions);

cake using this select :

`Userword`.`userwordid`, `Userword`.`userid`, `Userword`.`wordid`, `Userword`.`date`, `Userword`.`levelid`, `Word`.`wordid`, `Word`.`word`, `Word`.`meaning`, `User`.`UserId`, `User`.`Email`, `User`.`password`, `User`.`username`, `User`.`cell`, `User`.`web` FROM `userwords` AS `Userword` LEFT JOIN `words` AS `Word` ON (`Userword`.`wordid` = `Word`.`wordid`) LEFT JOIN `users` AS `User` ON (`Userword`.`userid` = `User`.`UserId`) WHERE date(`Userword`.`date`) = 'DATE_SUB(CURDATE(),INTERVAL 2 DAY)'  

but by this select mysql can’t return record because cakephp in this select use this character (') in last passage.
when i remove this character and test this code in phpmyadmin this code return rows. two images in below show this :

cakephp mysql code

image of phpmyadmin without <code>'</code> character

  • 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-28T17:58:31+00:00Added an answer on May 28, 2026 at 5:58 pm

    Just don’t separate it out as key => value pair:

    $conditions = array(
       ...
       'DATE(Userword.date) = DATE_SUB(CURDATE(), INTERVAL 0 DAY)'
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using cakephp and creating a form <?php echo $form->create('User', array('action' => 'cancel'));?>
I was using this tutorial http://bakery.cakephp.org/articles/Casmo/2010/06/26/creating-pdf-files-with-html2ps-html2pdf to set up html2ps with cakePhp. Everything is
Using CakePHP, I created select-option form element with: echo $form->select('items', $numeration , array('selected' =>
I'm creating a web application using cakephp 1.2.6. There is a functionality that I
This site is built using CakePHP 1.2* I have an element that needs to
I've got a small question about Creating Aro-s in Cakephp http://book.cakephp.org/#!/view/1547/Acts-As-a-Requester I'm using code
using cakephp 2.0 rc3. following validation in my model: var $validate = array( 'loginname'
I'm creating a website using the cakePHP framework and I and a newbie to
Using CakePHP 1.3 , I post a form which correctly fills in $this->data .
I am using cakephp framework to build my application. I want that, whenever a

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.