0
votes
1answer
45 views

foreach not printing the query result in cakephp

my controller $data= $this->Contact->find('all',array( 'conditions' => array('Contact.User_id' => $id))); $this->loadModel('Calllog'); foreach($data as ...
3
votes
2answers
141 views

CakePHP: findById() with Containable not returning expected associations

Here's my model: class Question extends AppModel { public $hasMany = array( 'CaseQuestions' => array('className'=>'Question', 'foreignKey'=>'parent_id') ); public $hasOne = array( ...
4
votes
1answer
143 views

CakePHP: Creating new HABTM row instead updates other

I have two models with a HABTM (Has and belongs to many) relationship: Qsets and Questions. The following action (in QsetsController.php) should result in a new row in the qsets_questions table, with ...
-1
votes
1answer
58 views

cakephp friendship between users Linking models together

What I need: A facebook-like friendship system. User (A) sends a requests for a friendship with User (B) User (B) confirmes the request User (A) and User (B) are friends now My problem: I'm ...
0
votes
2answers
91 views

SQL-query in cakephp-style

I'm working on a cakephp issue. I know how we do queries in cakephp. In certain circumstances you have to use the sql statement itself as query($sql). Below is a query to get the nearest points from a ...
0
votes
3answers
260 views

CakePHP 2.2.4: Why does this Union $this->Model->query not work?

I'm in the view action of my PhotosController.php. What I want to do is given the id of the current photo I am viewing, create a carousel of photos containing the two photos before and two photos ...
0
votes
3answers
227 views

CakePhp mysql raw query error

I'm new to cakephp. I'm trying to search through mysql tables. I want to use nested query. class TableController extends AppController{ . . public function show(){ $this->set('discouns', ...
0
votes
0answers
31 views

New record takes Random value

I have made on basic website for writing posts. I put my website live. In that most of all functions are working properly but when i am creating new post at that time , new post's value is total ...
1
vote
1answer
252 views

Float, Decimal, Int mysql fields returned as string on Cakephp 2.2

I have an App in CakePHP 2.2 & MySQL. I noticed that the type casting of the value returned is string for many types like Float, Decimal, Int, Varchar, Text etc..: Float or Decimal: ...
0
votes
2answers
322 views

Error: Integrity constraint violation: 1052 Column

why I'm getting this? Error: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'favorites' in field list is ambiguous SQL Query: UPDATE `twitter`.`tractions` AS `Traction` LEFT JOIN ...
0
votes
1answer
111 views

how to update cakephp2 auth component password form database

I am using cakphp2 with auth component. My requirement is to update the password in mysql database using phpmyadmin tool. Which hashing technique cakephp authcomponent use for password field? How do I ...
1
vote
2answers
34 views

How can I query for +/- 10 days TheDate in DB query

Okei,, so I am trying to retrieve some info from my database with a +/- 10 days setting. Values: Event.start_date = y-m-d Event.end_date = y-m-d My.date = y-m-d $conditions["My.date >="] = date( ...
0
votes
1answer
643 views

MySQL SELECT where boolean field is NULL or false

OK I must be missing something really simple here. I just want to return all records from a table where the user_id matches (easy!) and the 'paid' field is either NULL or 0. My 'paid' field is a ...
0
votes
2answers
149 views

How to search separated by comma value in cakephp

Need help in cakephp I have a field furnished_details in a table and its content is below value (separated by comma). eg . Double Bed,Flat TV : small (19"),Mirror,Extra storage,Window ...
0
votes
3answers
65 views

CakePHP 2.1 date attribute in table

I am using cakephp 2.1 and I have created a table actor(id, first_name, last_name, dob). Where dob is date of birth and having date format as Y-m-d. I would like to fetch the users who have their ...

1 2
15 30 50 per page