Re: Good example for associations?

2006-12-14 Thread AD7six
Hi Tazz, if you enable sql debugging (in /app/config/core.php set DEBUG = 2). You would see the sql error that is preventing you from getting any results. var $hasOne = array('Genre' =>... should be var $belongsTo = array('Genre' => .. as the foreign key for this relationship is in your albums

Re: Keeping unbindModel out of your controllers

2006-12-14 Thread Mikee Freedom
it has to be said - you rock! I was just at the point that I thought some of my controllers looked extremely unwieldy due to the bindModel and unbindModel calls I was making. Now with 2 or 3 logical lines everything stays nice and clean and my DB requests are always the size they need to be. Th

Re: Good example for associations?

2006-12-14 Thread Tazz
John David Anderson (_psychic_) wrote: > On Dec 14, 2006, at 11:46 AM, Tazz wrote: > > > > > Is there any tutorials out there explaining how to use associations? > > > > I'm trying to do it strictly from the maual and I can't seem to get it > > to work... > > How so? > > This should go without sa

Re: Errors in the View

2006-12-14 Thread nate
The problem is here: function view($id) { $this->set('data', $this->Category->read()); } You aren't passing the $id to read. The line should read either: $this->set('data', $this->Category->read(null, $id)); or, my personal favorite: $this->set('data', $t

RE: findAll query problem - mutiple conditions for one field not executing

2006-12-14 Thread Mariano Iglesias
Did he send a ticket? I thought we covered this with my previous response. -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! -

Looking for Cakephp developer in Toronto, Ontario, CA

2006-12-14 Thread Marta's World
Hi there, I am looking for a Toronto-based Cake Baker to join an ongoing project in Jan 2007. If anyone is interested please email me. Thanks. Cheers, Marta --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake P

Errors in the View

2006-12-14 Thread Jon M.
[ ... SORRY FOR THE LONG POST ... ] Hello! First off I love CakePHP, I was having issues working with RoR but CakePHP allows me to actually do something. I have played around with CakePHP and have learned a lot from my mistakes and the great people that have put up great examples and answers to p

Re: findAll query problem - mutiple conditions for one field not executing

2006-12-14 Thread nate
It gets overwritten because you're not allowed to have two array elements with the same key, it's impossible. See my response to your ticket: https://trac.cakephp.org/ticket/1766 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: $html->tableHeaders using the colspan for a single TH

2006-12-14 Thread Seb
I came accross this same problem 2 wks or so ago and decided I coun't live without that...! So I created my own helper, extending HtmlHelper and implemented the function as follow; [code location="my custom/extended helper"] /** * Returns a row of formatted and named TABLE headers. * * @param

Re: $html->tableHeaders using the colspan for a single TH

2006-12-14 Thread Falagar
The html Helper does not implement such a behavior. You either have attributes for all th's or for none. So you have a number of possibilities: you either don't use a helper and write the HTML yourself (which shouldn't be hard). Or (if you make use of this helper function very often and changing

Re: findAll query problem - mutiple conditions for one field not executing

2006-12-14 Thread gabordemeter
Ok, I have found the problem and a fix: The problem is that the first Abc.focus condition gets overwritten by the second one in the $conditions array like Mariano suggested above. The simplest solution looks like below: function aaa($focus_low, $focus_high) { $items = $this->Abc->findAll(arr

Ajax Div update doesn't write javascript

2006-12-14 Thread luis_y27
Hello everyone, I have a select box that onchange updates a division within my page. Inside this division there is some javascript that should get updated depending on the ajax update. However, none of my javascript is being written into the division after the update. I looked at the source and

Re: too many associations?

2006-12-14 Thread Gil Vidals
The bug is under number #1565 as an "enhancement". /data/cake/trunk/cake/1.x.x.x/cake/libs/model/dbo/dbo_mysql.php When saving to a model that doesn't follow the cake convention and has no auto_increment primary key, save makes a call to lastInsertID, which in turn calls $data = $this->fetchAll(

Re: too many associations?

2006-12-14 Thread Gil Vidals
I had the same type of problem and reported it as a bug. See the change I made to the file below. It made my queries fly. The problem is that the last_insert_id should return exactly ONE record according to Mysql documentation. For some reason the cake coders decided to return ALL changed record f

Re: too many associations?

2006-12-14 Thread gwoo
well, its hard to tell what you are doing. I guess it seems simple enough. Do you have DEBUG on 2 or 3. also, using pr($output); is usually a bit more efficient. With DEBUG on 2 you will see all the queries being produced so that really should be all you need 90% of the time. --~--~-~--~

Re: too many associations?

2006-12-14 Thread codecowboy
I am interested in hearing some responses to this as well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this g

Re: updating a div with ajax

2006-12-14 Thread luis_y27
Thanks for all your help I really appreciate it, I got it working by adding a get_rate_groups view into my views folder. However, this is not exactly what I wanted though because the div I'm trying to update is an element that I used in different views, if I was to follow this pattern then I would

redirect problem

2006-12-14 Thread M
Hello, i just uploaded an application made with cakephp to my site.The CakePHP original rewrite file i think redirect every request to /app/webroot Now, to see apache and php errors i should access the URL /login where a cgi panel should appear but the application tell me that it doesn't find log

Re: Good example for associations?

2006-12-14 Thread John David Anderson (_psychic_)
On Dec 14, 2006, at 11:46 AM, Tazz wrote: > > Is there any tutorials out there explaining how to use associations? > > I'm trying to do it strictly from the maual and I can't seem to get it > to work... How so? This should go without saying, but not providing any details makes it much harder

Good example for associations?

2006-12-14 Thread Tazz
Is there any tutorials out there explaining how to use associations? I'm trying to do it strictly from the maual and I can't seem to get it to work... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" gro

1:n relations and html helpers

2006-12-14 Thread dagi3d
Hi, suppose I have a 1:n relation where an item can have several images, and each image will have a description and a filename and I have the following view snippet: ... input('Image/description');?> ... What I would like to do is to send all the image's captions from the form as an array,

Re: Big sessions problems with Ajax

2006-12-14 Thread nate
Go into app/config/core.php, and change CAKE_SECURITY to 'medium' or 'low'. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubs

Re: updating a div with ajax

2006-12-14 Thread John David Anderson (_psychic_)
On Dec 14, 2006, at 10:50 AM, luis_y27 wrote: > thanks for your quick response John, I already have set up a > controller > action to respond to the ajax request. Also all necessary .js files > are > included in my code. I tried your suggestion and it worked but only > partially thought. M

Re: updating a div with ajax

2006-12-14 Thread luis_y27
thanks for your quick response John, I already have set up a controller action to respond to the ajax request. Also all necessary .js files are included in my code. I tried your suggestion and it worked but only partially thought. Mostly because I might not understand how the ajax call is receiv

Re: association for same table

2006-12-14 Thread gwoo
have a look at self joins. Here is an example from The Bakery. https://cakeforge.org/plugins/scmsvn/viewcvs.php/trunk/bakery/models/category.php?rev=352&root=bakery&view=markup --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

RE: Edit form for associated tables

2006-12-14 Thread Adrian Godong
The selectTag has a third (or fourth) parameter after the name/value arrays parameter that accepts selected single name or array of names. Matching name from name/value parameter and selected name parameter will have the selected attribute on the generated HTML tag. Let me know if you need more c

Re: updating a div with ajax

2006-12-14 Thread John David Anderson (_psychic_)
On Dec 14, 2006, at 8:27 AM, luis_y27 wrote: > > Hey I'm really stuck with something here, I would really appreciate > any > help. I'm trying to figure out how to update a division after an ajax > call. I have a div and within this div I render an element. Pretty > simple something like thi

RE: findAll query problem - mutiple conditions for one field not executing

2006-12-14 Thread Mariano Iglesias
First of all the way you are defining the conditions make use of an indexed array, so beware of overwriting the same index. Why don't you just break it down like: function aaa($focus_low, $focus_high) { $conditions = array ( 'Abc.users_id' => $this->Session->read('User.id'

updating a div with ajax

2006-12-14 Thread luis_y27
Hey I'm really stuck with something here, I would really appreciate any help. I'm trying to figure out how to update a division after an ajax call. I have a div and within this div I render an element. Pretty simple something like this div('rate_groups_div'); ?> renderElement('rate_groups'); ?>

$html->tableHeaders using the colspan for a single TH

2006-12-14 Thread [EMAIL PROTECTED]
I need add an attribute for only a th, but the $helper extend to every TH. I want create a colspan for the 3 th. Ho I can? $thop=array(COLSPAN=>1); $th = array ( $pagination->sortBy('id'), $pagination->sortBy('title'), $pagination->sortBy('created'),

findAll query problem - mutiple conditions for one field not executing

2006-12-14 Thread gabordemeter
I have a problem with a findAll() query. The code is: $items = $this->Abc->findAll(array( 'Abc.users_id' => $this->Session->read('User.id'), 'Abc.focus' => ">= 3", 'Abc.focus' => "<= 3" ), null

$ajax->submit complete, success, failure options and javascript vanishing??

2006-12-14 Thread [EMAIL PROTECTED]
Hi, I'm struggling with form input and different javascript that needs to be triggered depending on successfully validated form info and info that does not validate. First, the view I have is both an add entry form AND a records overview in one page. When a record is added with the form it adds

Re: association for same table

2006-12-14 Thread Erick Tedeschi
thanks!!! I obtained to make the association. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send em

filling of pdf formulars with php - problems with pdftk

2006-12-14 Thread Junnichi
Hello, I'm going to program a web application which should fill datafields of pdf files with data (from a database) and merge them to a new pdf file. I've heard about using pdftk (PDF Toolkit) to do this. But I've got some problems with the linux version I am not able to solve. I tried the follo

RE: association for same table

2006-12-14 Thread Mariano Iglesias
Maybe you are looking for to take advantage of findAllThreaded(). If so instead of categoria_id to name the parent field, name it parent_id: create table categorias ( id int not null auto_increment primary key, description text not null, nivel int, parent_id int ); Check this article out: http

Big sessions problems with Ajax

2006-12-14 Thread [EMAIL PROTECTED]
Hi, i'm stuck on a really annoying session problem : from a main page (called home), i fetch some other cake views into "portlets" (which are simple divs). These views are fetched with the Ajax.Updater method from prototype 1.5.0 rc1. The problem is that these views seem to not have any access t

Edit form for associated tables

2006-12-14 Thread igor
Hello, I have the following tables in the database: products, manufacturers, subcategories. Product has one manufacturer (associated with belongsTo / and hasMany the other way around) and multiple subcategories (HABTM). I created index, view, add and edit views, everything is working _almost_ per

association for same table

2006-12-14 Thread Erick Tedeschi
I am trying to make an association for the same table, to make registers of categories and sub-categories: I tried the following one: //mysql create table categorias ( id int not null auto_increment primary key, description text not null, nivel int, categoria_id int); when I generate the control

RE: Keeping unbindModel out of your controllers

2006-12-14 Thread Mariano Iglesias
Hehe... I'm glad that it's useful for you guys. -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! -Mensaje original- De: ca

Re: #sql_3e3a_0 for COUNT() queries

2006-12-14 Thread TT
And here is a complete hack if you want custom named values for the table-names (I use derived) function resultSet(&$results) { $this->results =& $results; $this->map = array(); $num_fields = mysql_num_fields($results); $inde

Re: AJAX issues for IE and Firefox

2006-12-14 Thread majna
$ajax->observe should be outside input_panel... also loading_gif use firebug FF ext /reports/loadReportConfiguration could render element... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" grou

observeForm() in ajax live search?

2006-12-14 Thread [EMAIL PROTECTED]
I have made an Live Search following this http://www.justkez.com/cakephp-livesearch/, now I need to add a radio to the form, so that users can specify the range of search. I have used $html->radio() to generate a radio, and changed observeField() to observeForm(), but, this Live Search doesn't wor

Re: #sql_3e3a_0 for COUNT() queries

2006-12-14 Thread TT
I already found it after digging a bit deeper into mysql/php The cause is this functionality: http://cn.php.net/manual/en/function.mysql-fetch-field.php which is used inside \cake\libs\model\dbo\dbo_mysql.php in function function resultSet() CakePHP retrieves the table-names from MySQL by the m

#sql_3e3a_0 for COUNT() queries

2006-12-14 Thread TT
Dear bakers, for some of my queries I use queries that contain a COUNT() and those are executed directly by execute() or query(). I do something like this: "COUNT(test.id) AS count" But since count does not belong to any Table, it gets assigned some random string in the resulting arra