Questions tagged with query

3 answers

0 votes

Asked by Lemon, on 1/11/09 in

2 answers

3 votes

Asked by JakubLedl, on 14/11/09 in

Query table in views

Hi. I'm learning CakePHP (using the blog app tutorial) and I want to get rid of that stupid table of SQL queries that shows in my views. So far I only found out that the table isn't passed in $content_for_layout variable, because it appends after...

3 answers

1 vote

Asked by powtac, on 18/11/09 in

Selecting just some fields in a HABTM findAll() query

How can I select a defined list of fields in a findAll() query which runs on a HABTM model. I have the model diagram with HABTM tags. In the tag model I use:


$this->Tag->findAll();

This returns a correct result but the query selects all(!)...

2 answers

-1 votes

Asked by genji, on 20/12/09 in

Getting AJAX to work with CakePHP

Hey guys i've been trying to increase the user experience of an application of mine by adding AJAX but i can't seem to find a decent tutorial?

Can anyone help me find a good working tutorial that makes use of cakephp + ajax?

Thanks in advance

2 answers

0 votes

Asked by davidwu, on 5/1/10 in

What's the best way to include Javascript into views?

I'll admit that of the M-V-C pattern's component parts, the View part is my weakest link. Even with elements, helpers and the like, my code ends up being large blobs of hard to read pieces of flotsam and jetsam. One major culprit is...

1 answer

0 votes

Asked by yesk13, on 7/1/10 in

possible to use find('list') across models?

are there any cakephp way of using find('list', array('fields' = array('User.id', 'Profile.nickname')))); ?

if i do that it'll throw an error.

for the time being i am using a function i wrote to get the list, not flexible function at that.

Your...

1 answer

0 votes

Asked by hey33, on 13/1/10 in

Subquery in Select From, how di I do this?

Hi, how do I convert this query (with subquery):

SELECT * FROM (SELECT * FROM Logs ORDER BY Logs.created DESC) AS a GROUP BY Logs.id ORDER BY Logs.created DESC

to a CakePHP find condition?

1 answer

0 votes

Asked by pedro84, on 18/1/10 in

CakePHP & Subselects

I got app that need to be recoded in CakePHP.

I got following select with subselects:


        SELECT COUNT(*) AS item1,
            (SELECT COUNT(*) FROM portal_members) AS item3, 
            (SELECT COUNT(*) FROM portal_reviews) AS item3, 
     ...

1 answer

0 votes

Asked by MetalJo, on 2/2/10 in

[Résolu] Utilisation de $ajax

Bonjour,

J'essaye d'utiliser $ajax pour l'envoie de mon formulaire (un livre d'or).


	echo $ajax->submit('Soumettre', array(
	    'url'=> array('controller'=>'messages', 'action'=>'add'), 
	    'condition' => 'valider()',
	    'update' =>...

1 answer

0 votes

Asked by kishorkundan, on 3/2/10 in

post data from Jquery to the cake's controller

I am using JQuery and Cakephp 1.2;

the problem is posting the data.

this is how m posting the data iterating over each fields in form.


$('input[type=submit]').click(function(bE) {
				bE.preventDefault();
				id = '#' +...

1 answer

0 votes

Asked by jamesl, on 8/2/10 in

iterate and echo array elements

Hi,

I have an in dex method with a find to select all distinct user id's in my user table;

$userId = $this-Order-find('all', array('fields'=array('DISTINCT(Order.user_id) AS user')));

which sends back the lovely array:

[userId] = Array([0] =...

1 answer

0 votes

Asked by ABCoder, on 8/2/10 in

Ajax pagination using JSON data

Cake has default ajax pagination feature, but the output is in html which is not a good idea and huge amount of data transfer.

I want to use JSON to reduce data transfer. Is there any "ready-made" stuff for pagination using json (and jQuery).

0 answers

1 vote

Asked by marion, on 11/2/10 in

Une seule requête sur plusieurs bases

Bonjour,

j'ai besoin de faire une seule requête sur plusieurs bases de données. J'ai défini mes associations pour que le LEFT JOIN se fasse correctement sur la table de l'autre base, la requête est correcte.

En revanche, bien que j'aie préfixé mes...

1 answer

0 votes

Asked by jamesl, on 15/2/10 in

query

Hi, what would this query look like as per cake?

'SELECT COUNT( * )FROM orders`LEFT JOIN `product_details` AS `ProductDetail` ON ( `orders`.`product_detail_id` = `ProductDetail`.`id` )WHERE `ProductDetail`.`new_or_used` = "New" GROUP BY...

1 answer

0 votes

Asked by TriLLi, on 2/3/10 in

Disable multidimensional array query result in cakephp model

Hi,

I would like to disable multidimensional array returned as result from query.

I would like to have it like simple query result array

2 answers

0 votes

Asked by blacksymmetry, on 6/3/10 in

Jquery in Cake, calling method

Hello, i would like to ask, what is simplest way to use JQuery in cake?

I would like use JQuery in sense, send form data to any contoller and function and put result into DIV on page without page refresh.

Something like:


<script...

1 answer

0 votes

Asked by bottomless, on 6/3/10 in

Complex find condition query encapsulating values in single quotes

Hi,

I'm moving a mysql query from 1.1 to 1.3-RC1


 $conditions = array("OR" => array(
      'Item.expiration'       => 0,
      'Item.expiration >'     => "NOW()"
    )
 );
 $params = array(
   'conditions'    => $conditions
);
 $items =...

2 answers

0 votes

Asked by jole, on 9/3/10 in

Standard ajax library

Well I read a lot, and now I have too much…

I need clarifying, and I hope I’m not only one.

Cake 1.2.6 standard ajax lib is prototype, and on this lib is based also ajax helper.

In some mailings/blogs I have read that this will be changed in further...

0 answers

0 votes

Asked by revenantprime, on 18/3/10 in

Use model within helper

Hi all,

I know MVC speaking it's not kosher to access a database within a helper, but this is the situation I'm in.

I'm creating a parser where people can specify thumbnails for images in the database by inserting a tag like [thumb, id, width,...

0 answers

0 votes

Asked by ateadev, on 12/4/10 in

Add pseudo column in model

Hi all,

I have a table/model Contract with id, price_normal, price_action.

I want to be able to sort on the pseudo column 'price_lowest' which contains the lowest of the fields price_normal and price_action.

I tried to add a MySQL query in the...

<< previous 1   2