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
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
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
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
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!
-
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
[ ... 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
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
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
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
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
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
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(
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
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.
--~--~-~--~
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
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
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
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
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
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,
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
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
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
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
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
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
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'
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'); ?>
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'),
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
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
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
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
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
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
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
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
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
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
$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
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
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
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
44 matches
Mail list logo