Re: Undefined variable: javascript

2010-03-31 Thread Jeremy Burns
Try:

$this->Html
$this->Javascript

Jeremy Burns
jeremybu...@me.com


On 1 Apr 2010, at 06:57, Ambika Kulkarni wrote:

> Notice (8): Undefined variable: javascript [APP/views/layouts/
> default.ctp, line 6]
> Fatal error: Call to a member function link() on a non-object in /var/
> www/cake/app/views/layouts/default.ctp on line 6
> 
> Controller Code is
> var $components = array('Auth');
> var $helpers = array('Javascript','Form','Html','Event');
> 
> default.ctp
> css('datepicker')."\n"; ?>
> link('datepicker.js')."\n"; ?>
> 
> $helpers array is defined only in AppController
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
> 
> To unsubscribe, reply using "remove me" as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Retrieving objects from the DB instead of arrays

2010-03-31 Thread adri...@jps.net
After your $model->find(), you can try the Set::map() function on the
resulting array (see: http://book.cakephp.org/view/676/map).  I
haven't personally used it myself, but the documentation indicates
"Basically, the map function turns array items into initialized class
objects."

On Mar 30, 8:31 pm, paws_galuten  wrote:
> I'm new to cakePHP and it seems like the only way to retrieve data
> from the data source is as an array. I'm finding that I am using a lot
> of code in my controller to prepare the arrays for display in the
> view, when I would rather be able to send an object to the view and
> get data from that object.
>
> For example, if I had a person object, I could have an attribute that
> was their birthdate and in the view I could easily get their age with
> something like $person->getAge(). If I only have the person as an
> array, then I have to do the calculating of the age before I can
> display it.
>
> Does this make sense? It is a simplistic example, but I can see myself
> having to write a lot of code to manipulate arrays before the raw
> database data is usable.
>
> Thanks for your insights,
> Jason

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Undefined variable: javascript

2010-03-31 Thread Ambika Kulkarni
Notice (8): Undefined variable: javascript [APP/views/layouts/
default.ctp, line 6]
Fatal error: Call to a member function link() on a non-object in /var/
www/cake/app/views/layouts/default.ctp on line 6

Controller Code is
 var $components = array('Auth');
 var $helpers = array('Javascript','Form','Html','Event');

default.ctp
css('datepicker')."\n"; ?>
link('datepicker.js')."\n"; ?>

 $helpers array is defined only in AppController

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Custom flash messages

2010-03-31 Thread Ed Propsner
I've been playing around trying to customize my flash messages with CSS and
I'm having a bit of trouble.

I tried to define the class with the message itself  

[code]$this->Session->setFlash(__(' Some Flash message here ',
array('class' => 'flash_failure')));[/code]

I also tried to use the example in the CookBook and create separate .ctp
files in the layouts folder and defining the views that way but that didn't
seem to work either.

The message shows up fine in the view but it shows as plain text and no CSS
style.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Can I do the following with cakephp?

2010-03-31 Thread cricket
On Apr 1, 12:46 am, Bankai  wrote:
> - Export results of a database table to excel

Have a look at this article:
http://bakery.cakephp.org/articles/view/csv-helper-php5

Be sure to see the author's updated version here:
http://ifunk.net/cakephp/helpers/csv.php.txt

Finally, here's my updated version:
http://pastebin.com/3bfNQRyC

I made a couple of changes also. I remember I had to play around with
the headers a bit. Same  as always when doing this sort of thing.

Here's a quick example of usage:

MembersController:
/**
 * Get a CSV dump of the membership
 *
 * @param   void
 * @return  void
 * @access  public
 */
public function admin_csv()
{
$this->set('data', $this->Member->getDataDump());
$this->set('filename', 'members_'.date('Y-m-d').'.csv');
Configure::write('debug', 0);
$this->layout = 'ajax';
$this->viewPath = 'elements';
$this->render('csv_dump');
}

Member:
/**
 * retrieve Member data for CSV output
 *
 * @param   void
 * @return  void
 * @access  public
 */
public function getDataDump()
{
$filters = array(
'conditions' => array('Member.admin' != 1),
'fields' => array(
'Member.id',
'Member.founding',
'Member.first_name',
'Member.last_name',
'Member.organisation',
'User.email',
'Member.address_1',
'Member.address_2',
'Member.city',
'Region.name',
'Country.name',
'Member.postal_code',
'Member.telephone',
'Member.fax'
),
'contain' => array('User', 'Region', 'Country'),
'order' => array('Member.last_name' => 'DESC')
);
$tmp = $this->find('all', $filters);

$data = array();

foreach ($tmp as $key => $row)
{
$data[] = array(
'id' => $row['Member']['id'],
'founding' => ($row['Member']['founding'] ? 'yes' : 
'no'),
'first_name' => $row['Member']['first_name'],
'last_name' => $row['Member']['last_name'],
'organisation' => $row['Member']['organisation'],
'email' => $row['User']['email'],
'address_1' => $row['Member']['address_1'],
'address_2' => $row['Member']['address_2'],
'city' => $row['Member']['city'],
'region' => $row['Region']['name'],
'country' => $row['Country']['name'],
'postal_code' => $row['Member']['postal_code'],
'telephone' => $row['Member']['telephone'],
'fax' => $row['Member']['fax']
);
}

return $data;
}

app/views/elements/csv_dump.ctp:

setFilename($filename);
$csv->clean_output = true;
$csv->addGrid($data);
echo $csv->render();


> - Have an autosave feature like google docs into my web app

That's a client-side thing. Use AJAX to periodically save your data.

> - Whats the best javascript framework (jquery, mootools, prototype,
> etc) to use along with cakephp

Until recently, Prototype was the only JS framework that Cake had
built-in methods for. But that has changed. I know jQuery is now
supported but I'm not sure of the others. I don't bother using the
helpers, myself, as I've always preferred jQuery (and so was forced
not to use the helpers).


> And now the biggie!
> - Lets say I live in a third world country (which I do), and the
> lights go out every once in a while. Can I develop a program with
> cakephp, where each workstation thats connected to the server (where
> my web app is) save its own copy of the work that they are doing?
> Until that connection resumes to the server? What I want to do is
> avoid loss of data if the lights go out somehow. We know that if we
> are working in a word doc, and the machine unfortunately freezes or
> shuts down for whatever reason, the next time we open MS Word it pops
> out a file recovery dialog, and we know the rest. I want to develop
> something like that with a cakephp in my web app.

The periodic autosave mentioned above is about all i can think of, and
so will only have saved up to n minutes before the power happens to
quit. Once the power dies, there's nothing your workstation can do to
send data to the server. It becomes a doorstop immediately.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe fro

Re: always use singular model and controller names

2010-03-31 Thread Jeremy Burns
Try adding some custom inflections (plurals):

http://book.cakephp.org/view/953/Inflections

Jeremy Burns
jeremybu...@me.com


On 31 Mar 2010, at 22:42, tekcorap wrote:

> Hi everyone, I have a small problem. I'm using CakePHP 1.2.6.
> Unfortunately, not as in English plurals in Turkish. eg
> "makale"(article) in the plural of the word Turkish "makaleler" (not
> articles). Create a model when I check the articles CakePHP table
> names should be in the form of my makalelers. I do not use any English
> name control.I do not want to have plural model names automatically.
> All names must be singular model. how can I do?
> 
> Thank you for your help.
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
> 
> To unsubscribe, reply using "remove me" as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Can I do the following with cakephp?

2010-03-31 Thread Bankai
- Export results of a database table to excel
- Have an autosave feature like google docs into my web app
- Whats the best javascript framework (jquery, mootools, prototype,
etc) to use along with cakephp

And now the biggie!
- Lets say I live in a third world country (which I do), and the
lights go out every once in a while. Can I develop a program with
cakephp, where each workstation thats connected to the server (where
my web app is) save its own copy of the work that they are doing?
Until that connection resumes to the server? What I want to do is
avoid loss of data if the lights go out somehow. We know that if we
are working in a word doc, and the machine unfortunately freezes or
shuts down for whatever reason, the next time we open MS Word it pops
out a file recovery dialog, and we know the rest. I want to develop
something like that with a cakephp in my web app.

If you know how, please guide me somewhere, don't just say "yes you
can". Any help It would be greatly appreciated.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: App::import - not working, how to bugtrace

2010-03-31 Thread cricket
On Mar 31, 7:36 pm, schizophrenie  wrote:
> Hi  @ all,
>
> i was following up a googlemap tutorial, i've recognized that the code
> is old, so i've updated nearly everything but one thing isn't
> working.
>
> instead of vendor('googlegeo')  i am using  App::import('Vendor',
> 'googlegeo')
> but i think its not loading, because my class within is not
> recognized,

Are you sure that the class name is 'googlegeo'? Check the case.

Try also giving the path to the file:

App::import('Vendor', 'googlegeo', array('file' => PATH))

Where PATH is the path to the file from the vendors dir, ie if it's in
app/vendors/google/google_geo.php you specify 'google/google_geo.php'
as the path.

> i've also tried it with App::import('Controller', 'Users')
> to create a new UsersController, which has also failed.

That class name should be UsersController.

> how can i test if my app is loading the file?

$googlegeo = new googlegeo(); //or whatever the actual class name is

If that fails spectacularly, your file wasn't loaded.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


App::import - not working, how to bugtrace

2010-03-31 Thread schizophrenie
Hi  @ all,

i was following up a googlemap tutorial, i've recognized that the code
is old, so i've updated nearly everything but one thing isn't
working.

instead of vendor('googlegeo')  i am using  App::import('Vendor',
'googlegeo')
but i think its not loading, because my class within is not
recognized, i've also tried it with App::import('Controller', 'Users')
to create a new UsersController, which has also failed.

how can i test if my app is loading the file?

thank you very much.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


always use singular model and controller names

2010-03-31 Thread tekcorap
Hi everyone, I have a small problem. I'm using CakePHP 1.2.6.
Unfortunately, not as in English plurals in Turkish. eg
"makale"(article) in the plural of the word Turkish "makaleler" (not
articles). Create a model when I check the articles CakePHP table
names should be in the form of my makalelers. I do not use any English
name control.I do not want to have plural model names automatically.
All names must be singular model. how can I do?

Thank you for your help.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


All my Page can't find/index

2010-03-31 Thread punyaronald
Hii ...

My website host at Multiple Server. Main server at Indonesia (http://
www.jayakartahotelsresorts.com) . at this server my website running
well.
But i have problem at other server, Server Singapore (http://
sg.jayakartahotelsresorts.com) and server USA (http://
us.jayakartahotelsresorts.com). at that server all my page can't read/
index. Notification bellow :
Object not found!

The requested URL was not found on this server. The link on the
referring page seems to be wrong or outdated. Please inform the author
of that page about the error.

If you think this is a server error, please contact the webmaster.
Error 404
us.jayakartahotelsresorts.com
Wed 31 Mar 2010 10:09:57 AM WIT
Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8b DAV/2 PHP/5.2.5
mod_perl/2.0.4 Perl/v5.8.8
--

please advice how to solve the problem. Thanks
Ronald

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Queue plugin trouble

2010-03-31 Thread cricket
I've set up the Queue plugin to handle email jobs for a site. It's
worked pretty well but suddenly I'm seeing multiple emails go out or
none at all. It seems that the worker is either not being launched or
is failing to properly update the DB (so completed jobs are not marked
as such). I should note that I'm not running the workers from a cron
job but executing them immediately from my controller. It calls the
plugin component's load() which then creates the job, then it should
run a worker (which would then run my shell task).

public function load($task_name, $data = array())
{
if ($queued = $this->QueuedTask->createJob($task_name, $data))
{
// 
http://www.zeen.co.uk/code/view/run-cakephp-console-from-a-component
$cmd = 'nohup
'.CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'cake'
. ' -app '.APP.' queue runworker >/dev/null &';

exec($cmd);
}
return $queued;
}

Is anyone familiar with this plugin? I'm having some trouble figuring
out how best to debug this.

http://bakery.cakephp.org/articles/view/cakephp-simple-queue-plugin
http://wiki.github.com/MSeven/cakephp_queue/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Newbie question for "best practice" on how to combine CakePHP with a (given) design

2010-03-31 Thread janitor048
Hey guys,

thanks a lot for these very useful hints. I will definitely do some
more reading and start experimenting along the lines of your
suggestions.
And probably come back with more specific questions then.. :-)

Cheers,
Oliver


On Mar 29, 6:05 pm, cricket  wrote:
> To add to Jeremy's comments,
>
> In your menu elements, you can refer to the present location with
> $this->here, so you can have logic for showing/hiding submenus, etc.
> and avoid having to create separate layouts for each menu situation.
>
> For my login_prompt element, I check if the user is already logged in
> like this:
>
> if (!$session->read('Auth.User'))
> {
>    // show "login" link}
>
> else
> {
>    // show "logout" and "profile" links
>
> }
>
> If your users table has an "admin" column (0 or 1) you can do if
> ($session->read('Auth.User.admin')) to test whether you should include
> admin-specific links or whatever. Note that User is uppercase, as
> that's the name of the model. In your controllers, though, you'd use
> AuthComponent's user() method: $this->Auth->user('admin').
>
> For including disparate bits of code you can place several $this->element() 
> calls and use requestAction() in the elements. Make sure
>
> you have caching enabled in core.php and specifify that you want the
> element to be cached because each requestAction() call creates an
> entirely new request through Cake, which is expensive. By caching the
> element you avoid doing that each time. See this article:
>
> http://bakery.cakephp.org/articles/view/creating-reusable-elements-wi...
>
> Or search for "cakephp requestaction cache" or similar.
>
> On Mar 29, 8:49 am, janitor048  wrote:
>
> > Hi there,
>
> > I'm pretty new to CakePHP (and MVC in general for that matter) and I'm
> > just working through the docs etc.
> > And since the cookbook is quite informative, I think I've got a pretty
> > good idea of what CakePHP could do for me by now.
>
> > However, I would like to ask a question on best or common practice on
> > how to actually integrate my pieces of cake with a given design.
> > So that I can keep these suggestions in mind when digging even deeper
> > into the documentation.
>
> > Say, I've got a webpage that features
> > - a main "view" area in the center
> > - a main menu at the top that stays constant over all pages
> > - a side menu to the left that stays constant over some pages but does
> > in general depend on the content of the central area
> > - a small side area to the right with some login / admin bits-and-
> > pieces.
>
> > Pretty common and probably pretty close to the actual project I'm
> > about to work on.
> > The general layout as described above I would like to design using
> > dreamweaver (for instance) and setting up a css formatted page using
> > divs.
>
> > The main toolbar would probably best go into a common cake layout
> > file. But what about the rest? View files with elements for left menu
> > and login-area on the right? Login stuff as an element and the left
> > menu in layout files that are selected by the controller accordingly?
>
> > Can I attach id-based css rules to a specific element created by a
> > (say) form helper? For positioning purposes and the like..
>
> > And finally: What is the best way to incorporate bits and pieces from
> > different models / controllers into a single view? That would
> > something like a summary page, e.g. showing the 5 latests news, the 3
> > latest pictures and the most popular comments (or whatever you like)
> > in different areas of a single page (as delivered to the user).
>
> > Any hints and suggestions would be highly appreciated.
> > Cheers,
> > Oliver

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Use singleton for database connection

2010-03-31 Thread Christian Leskowsky
Could you give us more background?

On Wed, Mar 31, 2010 at 4:06 PM, dyutiman wrote:

> Hi,
> I need to run multiple processes of my application, built in Cakephp.
> And for that I need it to use singleton for its database class. Is
> there any way I can achieve that here...
>
> Have anybody  thought about this..
>
> thanks
> Dyutiman
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
> To unsubscribe, reply using "remove me" as the subject.
>



-- 
-

"You can't reason people out of a position they didn't use reason to get
into."

Christian Leskowsky

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Use singleton for database connection

2010-03-31 Thread dyutiman
Hi,
I need to run multiple processes of my application, built in Cakephp.
And for that I need it to use singleton for its database class. Is
there any way I can achieve that here...

Have anybody  thought about this..

thanks
Dyutiman

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: $this->...->query("...");

2010-03-31 Thread John Andersen
I suggest you turn on debug and print out what is returned from the
query, because the query is going straight to the database - CakePHP
is not doing anything to it! So what you see in your debug information
in your first post is not related to this query!
What your first post debug information shows, look like a pagination -
a count and a find!
Can you check and clarify what is your real issue here?
Enjoy,
   John

On Mar 31, 9:26 pm, Dominik Kukacka  wrote:
> Hey my complete function is:
>
>         $user = $this->Auth->user();
>         $this->Planet->recursive = 0;
>
>         $planets = $this->Planet->query("SELECT *
>                                         FROM planets AS Planet
>                                         LEFT OUTER JOIN buildings AS
> Building
>                                         ON (Planet.id =
> Building.planet_id)
>                                         WHERE Building.user_id=".
> $user['User']['id'].";");
>
>         $this->set('planets',$planets);
>
> greets
> Dom
>
[snip]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: $this->...->query("...");

2010-03-31 Thread Dominik Kukacka
Hey my complete function is:

$user = $this->Auth->user();
$this->Planet->recursive = 0;

$planets = $this->Planet->query("SELECT *
FROM planets AS Planet
LEFT OUTER JOIN buildings AS
Building
ON (Planet.id =
Building.planet_id)
WHERE Building.user_id=".
$user['User']['id'].";");

$this->set('planets',$planets);

greets
Dom

On 31 Mrz., 19:40, John Andersen  wrote:
> We need more information! How are you realizing your query - are you
> using CakePHP models find or query method?
> Please show the code where you are using your query!
> Enjoy,
>    John
>
> On Mar 31, 6:18 pm, Dominik Kukacka  wrote:
>
>
>
> > Hey everyone,
>
> > i tried to make an join query on two tables!
>
> > my query is:
>
> >    SELECT *
> >    FROM planets AS Planet
> >    LEFT OUTER JOIN buildings AS Building  ON (Planet.id =
> > Building.planet_id)
> >    WHERE Building.user_id=1;
>
> > so, the query works well in my PMA and in Workbench (CL),
> > but in cakePHP it makes some additional querys:
>
> > SELECT COUNT(*) AS `count`
> > FROM `planets` AS `Planet`
> > WHERE ((Planet IN ('1', 'Planet Erde', '100', '1', '100', '10', '10',
> > '10', '[1,20,20]', '400'))
> > AND (Building IN ('1', '1', '1', 'command_center', '1', '[25,25]')))
> > AND ((Planet IN ('2', 'Mond', '100', '0', '100', '0', '10', '-5',
> > '[1,21,20]', '100'))
> > AND (Building IN ('3', '2', '1', 'explorer_small', '2', '[10,4]')))
>
> > SELECT `Planet`.`id`, `Planet`.`name`, `Planet`.`space`,
> > `Planet`.`space_used`, `Planet`.`healthpoints`, `Planet`.`oil`,
> > `Planet`.`water`, `Planet`.`heat`, `Planet`.`coordinates`,
> > `Planet`.`size`
> > FROM `planets` AS `Planet`
> > WHERE ((Planet IN ('1', 'Planet Erde', '100', '1', '100', '10', '10',
> > '10', '[1,20,20]', '400'))
> > AND (Building IN ('1', '1', '1', 'command_center', '1', '[25,25]')))
> > AND ((Planet IN ('2', 'Mond', '100', '0', '100', '0', '10', '-5',
> > '[1,21,20]', '100'))
> > AND (Building IN ('3', '2', '1', 'explorer_small', '2', '[10,4]')))
> > LIMIT 20
>
> > This doesn relly can work because of: Planet IN ('1', 'Planet Erde',
> > '100', '1', '100'.. doesn't really make sense; ey?
> > Why does cakePHP do that?
>
> > greets from Vienna
> > Dom

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Validating not in list

2010-03-31 Thread Bart Vangeneugden
Hello,

thanks for the responses. I used custom validation the way moos3 suggested.


Thanks,
Bart

On Wed, Mar 31, 2010 at 18:33, John Andersen wrote:

> I would go with the custom validation, as you suggested!
> Enjoy,
>   John
>
> On Mar 30, 10:19 pm, Bart  wrote:
> > Hello,
> >
> > I'm trying to build an application that is User based.
> > However, I want to reserve some nicknames so you can't register them.
> >
> > When going over the validation rules, I findhttp://
> book.cakephp.org/view/1171/inList
> > Which is basically what I need, but negated.
> >
> > Is there a way to say something like "not inList". Or just any way to
> > negate that statement?
> > Or should I just define a function for it?
> >
> > Thanks,
> > Bart
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
> To unsubscribe, reply using "remove me" as the subject.
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: $this->...->query("...");

2010-03-31 Thread John Andersen
We need more information! How are you realizing your query - are you
using CakePHP models find or query method?
Please show the code where you are using your query!
Enjoy,
   John

On Mar 31, 6:18 pm, Dominik Kukacka  wrote:
> Hey everyone,
>
> i tried to make an join query on two tables!
>
> my query is:
>
>    SELECT *
>    FROM planets AS Planet
>    LEFT OUTER JOIN buildings AS Building  ON (Planet.id =
> Building.planet_id)
>    WHERE Building.user_id=1;
>
> so, the query works well in my PMA and in Workbench (CL),
> but in cakePHP it makes some additional querys:
>
> SELECT COUNT(*) AS `count`
> FROM `planets` AS `Planet`
> WHERE ((Planet IN ('1', 'Planet Erde', '100', '1', '100', '10', '10',
> '10', '[1,20,20]', '400'))
> AND (Building IN ('1', '1', '1', 'command_center', '1', '[25,25]')))
> AND ((Planet IN ('2', 'Mond', '100', '0', '100', '0', '10', '-5',
> '[1,21,20]', '100'))
> AND (Building IN ('3', '2', '1', 'explorer_small', '2', '[10,4]')))
>
> SELECT `Planet`.`id`, `Planet`.`name`, `Planet`.`space`,
> `Planet`.`space_used`, `Planet`.`healthpoints`, `Planet`.`oil`,
> `Planet`.`water`, `Planet`.`heat`, `Planet`.`coordinates`,
> `Planet`.`size`
> FROM `planets` AS `Planet`
> WHERE ((Planet IN ('1', 'Planet Erde', '100', '1', '100', '10', '10',
> '10', '[1,20,20]', '400'))
> AND (Building IN ('1', '1', '1', 'command_center', '1', '[25,25]')))
> AND ((Planet IN ('2', 'Mond', '100', '0', '100', '0', '10', '-5',
> '[1,21,20]', '100'))
> AND (Building IN ('3', '2', '1', 'explorer_small', '2', '[10,4]')))
> LIMIT 20
>
> This doesn relly can work because of: Planet IN ('1', 'Planet Erde',
> '100', '1', '100'.. doesn't really make sense; ey?
> Why does cakePHP do that?
>
> greets from Vienna
> Dom

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Set class help needed

2010-03-31 Thread cricket
On Mar 31, 10:16 am, "Dr. Loboto"  wrote:
> If you pass "fields" option to find("list") as described for grouping
> - this will do all the magic.

Thanks, both, for the tip. I'd forgotten about that option (I don't
think I've used it before). I'm not sure that it'll work in this case,
though, as I'm querying the members table and containing both
countries & regions for the names.

I've already got a complicated method to retrieve a list of countries
and regions that is used elsewhere. In the other place, I'm creating a
list of links of country names, with sublists of regions for those
countries that have them. The former are links to /members/country/[A-
Z]{2} and the latter, /members/region/[A-Z]{2}. Getting the list
involves querying on distinct Member.country_id and distinct
Member.region_id and then merging the two. So, only countries and
regions that have members are represented.

public function locations()
{
$countries = Set::extract(
$this->find(
'all',
array(
'fields' => 
array('DISTINCT(Member.country_id)'),
'contain' => array(
'Country' => array(
'fields' => array('*')
)
)
)
),
'{n}.Country'
);

foreach($countries as $key => $country)
{
if (in_array($country['iso_code'], array('US', 'CA')))
{
$countries[$key]['regions'] = Set::extract(
$this->find(
'all',
array(
'fields' => 
array('DISTINCT(Member.region_id)'),
'conditions' => array(
'NOT' => 
array('Member.region_id' => null),
'Member.country_id' => 
$country['id']
),
'contain' => array(
'Region' => array(
'fields' => 
array('*'),
'order' => 
array('Region.name' => 'ASC')
)
)
)
),
'{n}.Region'
);
}
}
return $countries;
}

This results in the array I posted earlier as the data I was starting
out with. Now, I need to create a select list from that data to show
elsewhere. Of course, I can't have the form point to both country and
region so I decided to only list the regions, grouped by country. In
this case, that's US & Canada. Other countries are not presented. This
suits the client because their membership is limited to those two.
However, there are edge cases where existing members live abroad.

What I ended up doing is abandoning Set and doing it the old-fashioned
way:

$options = array();
foreach($data as $k => $d)
{
if (!in_array($d['iso_code'], array('US', 'CA')))
{
unset($data[$k]);
}
else
{
$options[$d['name']] = array();

foreach($d['regions'] as $region)
{
$options[$d['name']][$region['iso_code']] = 
$region['name'];
}
}
}

It's damned ugly but it works. I'm using requestAction() and caching
the elements, so I'm not too concerned about the overhead.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Cake 1.2.6 - Can't bake anything

2010-03-31 Thread jejk
Hello

Have you checked driver issues :

http://osdir.com/ml/CakePHP/2009-07/msg00275.html

http://forums.iis.net/t/1156341.aspx

JK

On 30 mar, 14:53, McFrosty  wrote:
> So, I'm new to Cake...that being said, I followed all the directions
> and went through the blog tutorial, so I have a tender grasp of how
> it's supposed to work.
>
> I tried baking my first application today and have met with nothing
> but failure.  While I was able to set up the console without any
> errors, and I was able to bake the project and set up the database
> correctly, anytime I tried to bake the models or run 'bake all' I was
> met with:
>
> Bake All
> ---
> PHP Warning:  mssql_connect(): Unable to connect: SQL Server is
> unavailable or d
> oes not exist.  Connection is busy. (severity 9) in C:\Inetpub\wwwroot
> \cake12\ca
> ke\libs\model\datasources\dbo\dbo_mssql.php on line 144
>
> Warning: mssql_connect(): Unable to connect: SQL Server is unavailable
> or does n
> ot exist.  Connection is busy. (severity 9) in C:\Inetpub\wwwroot
> \cake12\cake\li
> bs\model\datasources\dbo\dbo_mssql.php on line 144
> PHP Warning:  mssql_connect(): Unable to connect to server:
> itsql.oar.tamu.edu
> in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
> \dbo_mssql.php on li
> ne 144
>
> Warning: mssql_connect(): Unable to connect to server:
> itsql.oar.tamu.edu in C:
> \Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo\dbo_mssql.php
> on line 14
> 4
> PHP Warning:  mssql_select_db(): supplied argument is not a valid MS
> SQL-Link re
> source in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
> \dbo_mssql.ph
> p on line 151
>
> Warning: mssql_select_db(): supplied argument is not a valid MS SQL-
> Link resourc
> e in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
> \dbo_mssql.php on
> line 151
> PHP Warning:  mssql_query(): supplied argument is not a valid MS SQL-
> Link resour
> ce in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
> \dbo_mssql.php on
>  line 175
>
> Warning: mssql_query(): supplied argument is not a valid MS SQL-Link
> resource in
>  C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
> \dbo_mssql.php on line
>  175
> Error: Your database does not have any tables.
>
> I see several of these errors on the cakephp forum, with no real
> answer.  Does anybody have a clue as to what I might be doing wrong?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


$this->...->query("...");

2010-03-31 Thread Dominik Kukacka
Hey everyone,

i tried to make an join query on two tables!

my query is:

   SELECT *
   FROM planets AS Planet
   LEFT OUTER JOIN buildings AS Building  ON (Planet.id =
Building.planet_id)
   WHERE Building.user_id=1;

so, the query works well in my PMA and in Workbench (CL),
but in cakePHP it makes some additional querys:

SELECT COUNT(*) AS `count`
FROM `planets` AS `Planet`
WHERE ((Planet IN ('1', 'Planet Erde', '100', '1', '100', '10', '10',
'10', '[1,20,20]', '400'))
AND (Building IN ('1', '1', '1', 'command_center', '1', '[25,25]')))
AND ((Planet IN ('2', 'Mond', '100', '0', '100', '0', '10', '-5',
'[1,21,20]', '100'))
AND (Building IN ('3', '2', '1', 'explorer_small', '2', '[10,4]')))

SELECT `Planet`.`id`, `Planet`.`name`, `Planet`.`space`,
`Planet`.`space_used`, `Planet`.`healthpoints`, `Planet`.`oil`,
`Planet`.`water`, `Planet`.`heat`, `Planet`.`coordinates`,
`Planet`.`size`
FROM `planets` AS `Planet`
WHERE ((Planet IN ('1', 'Planet Erde', '100', '1', '100', '10', '10',
'10', '[1,20,20]', '400'))
AND (Building IN ('1', '1', '1', 'command_center', '1', '[25,25]')))
AND ((Planet IN ('2', 'Mond', '100', '0', '100', '0', '10', '-5',
'[1,21,20]', '100'))
AND (Building IN ('3', '2', '1', 'explorer_small', '2', '[10,4]')))
LIMIT 20

This doesn relly can work because of: Planet IN ('1', 'Planet Erde',
'100', '1', '100'.. doesn't really make sense; ey?
Why does cakePHP do that?

greets from Vienna
Dom

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Undefined index

2010-03-31 Thread John Andersen
Please look at the code at line 32 from the indexsln.ctp file. Compare
the index names with the expected structure. Do you really have an
index named "Endpoint"?
If you still can't see the error, then please show the code at line
32, so we also may be able to look at it :)
Enjoy,
   John

On Mar 31, 4:35 pm, newbie  wrote:
> Hi All,
>
> I'm getting error:
> Notice (8): Undefined index: Audit [APP\views\audits\indexsln.ctp,
> line 32]
> Notice (8): Undefined index: Endpoint
>
> the codes are
>
> index.ctp:
>
>          $options = array_combine ($a_eid, $a_sln);
>    //$form->create('audits'
>     echo $form->create('Audit', array( 'controller' => 'audits',
> 'type' => 'post', 'action' => 'indexsln'));
>     echo $form->select('endpoint_id',$options);//,null,null,false);
>     echo $form->submit('ok');
>     echo $form->end();     ?>
>
> audits_controllers :
>
>         function indexsln()    {
>                 $id = $this->data['Audit']['endpoint_id'];
>                 echo $id; //$sln;
>
>                 $this->set('audits',$this->Audit->query(
>                                 "SELECT * FROM audits,endpoints WHERE 
> endpoint_id
> in
>                                 (SELECT id FROM endpoints WHERE sln in
>                                 (SELECT sln FROM endpoints WHERE id = 
> ".$id."))
>                                 AND audits.endpoint_id = endpoints.id "));
>
>                                 $data=$this->paginate($this->Audit->read());
>     }
>
> indexsln.ctp :
>
> 
> 
> 
>  echo $paginator->counter(array(
> 'format' => __('Page %page% of %pages%, showing %current% records out
> of %count% total, starting on record %start%, ending on %end%', true)
> ));
> ?>
> 
> 
>         sort('id');?>
>         sort('endpoint_id');
>                 ?>
>         sort('day');
>                 echo $paginator->sort('date');?>
>         sort('author');?>
>         sort('description');?>
>         sort('action');?>
>         sort('visible');?>
>         
> 
>  $i = 0;
> foreach ($audits as $audit):
>         $class = null;
>         if ($i++ % 2 == 0) {
>                 $class = ' class="altrow"';
>         }
> ?>
>         >
>                 
>                           // line 32
>                 
>
> debuger result example:
>
>     [viewVars] => Array
>         (
>             [audits] => Array
>                 (
>                     [0] => Array
>                         (
>                             [audits] => Array
>                                 (
>                                     [id] => 6
>                                     [endpoint_id] => 12
>                                     [ton_id] =>
>                                     [day] => 2010-01-16
>                                     [created] => 2010-01-16 20:40:28
>                                     [author] => Ktos
>                                     [trid] => 123444
>                                     [description] => Did Something
>                                     [action] => Change
>                                     [visible] => 0
>                                 )
>
>                             [endpoints] => Array
>                                 (
>                                     [id] => 12
>                                     [ton_id] => 1
>                                     [name] => RU22005-RDFSWQ990099
>                                     [sln] => RU22005
>                                     [fga] =>
>                                     [date] => 2009-11-29 01:39:00
>                                     [push] => Success
>                                     [activation] => Success
>                                     [created] => 2009-11-29 01:43:00
>                                     [modified] => 2009-11-29 01:43:00
>                                     [col1] => k
>                                     [col2] => k
>                                     [col3] => k
>                                     [col4] =>
>                                     [col5] =>
>                                     [col6] =>
>                                     [col7] =>
>                                     [col8] =>
>                                     [col9] =>
>                                 )
>
>                         )
>
> i have the same code as indexsln.ctp in other function when i'm
> sending data using fndAllBy - it's all ok then.
> dubuger seems to be ok in both cases.
>
> Can you please point out what i'm doing wrong?
>
> thx

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "rem

Re: Class 'TreeBehavior' not found

2010-03-31 Thread John Andersen
Ok, just saw the next message in the line! SOLVED


On Mar 31, 7:36 pm, John Andersen  wrote:
> You probably have to include it yourself, probably using App::import,
> but that is only a guess from my side :)
> Enjoy,
>    John
>
> On Mar 31, 1:19 pm, Michel Kogan  wrote:
>
> > when class GroupTreeBehavior extending class TreeBehavior, I got this
> > error:
>
> > [quote]
> > Fatal error: Class 'TreeBehavior' not found in /var/www/cakephp/app/
> > models/behaviors/group_tree.php on line 2
> > [/quote]
>
> > line 2 is:
>
> > [code]
> > class GroupTreeBehavior extends TreeBehavior
> > [/code]
>
> > what's the problem ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Class 'TreeBehavior' not found

2010-03-31 Thread John Andersen
You probably have to include it yourself, probably using App::import,
but that is only a guess from my side :)
Enjoy,
   John

On Mar 31, 1:19 pm, Michel Kogan  wrote:
> when class GroupTreeBehavior extending class TreeBehavior, I got this
> error:
>
> [quote]
> Fatal error: Class 'TreeBehavior' not found in /var/www/cakephp/app/
> models/behaviors/group_tree.php on line 2
> [/quote]
>
> line 2 is:
>
> [code]
> class GroupTreeBehavior extends TreeBehavior
> [/code]
>
> what's the problem ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Validating not in list

2010-03-31 Thread John Andersen
I would go with the custom validation, as you suggested!
Enjoy,
   John

On Mar 30, 10:19 pm, Bart  wrote:
> Hello,
>
> I'm trying to build an application that is User based.
> However, I want to reserve some nicknames so you can't register them.
>
> When going over the validation rules, I 
> findhttp://book.cakephp.org/view/1171/inList
> Which is basically what I need, but negated.
>
> Is there a way to say something like "not inList". Or just any way to
> negate that statement?
> Or should I just define a function for it?
>
> Thanks,
> Bart

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Help! Files being read from wrong directory

2010-03-31 Thread TobyG
That did it.  Thanks.  :o)

Note to self... ask before spending hours trying to work it out
yourself!!!

T

On Mar 31, 3:13 pm, "Dr. Loboto"  wrote:
> Clear Cake caches. This may occur if you copy temps from one install
> to another.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Possible to blank (hide) columns and show those again in a complete rendered view?

2010-03-31 Thread sebb86
Hello,

With this code, my problem is solved.

[CODE]

function toggleColumn(table, column) {
for (var i = 0; i < table.rows.length; i++){
if (table.rows[i].cells.length > column){
var cell = table.rows[i].cells[column];
cell.style.display = (cell.style.display == "none")? 
"": "none";
}
}
}

[/CODE]


[View CODE]

  
  1
  2
  3
  4
  5
  6
  


  

  

  [Optionen]
  ...
   ...
[/CODE]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Undefined index

2010-03-31 Thread newbie
Hi All,

I'm getting error:
Notice (8): Undefined index: Audit [APP\views\audits\indexsln.ctp,
line 32]
Notice (8): Undefined index: Endpoint

the codes are

index.ctp:

 create('audits'
echo $form->create('Audit', array( 'controller' => 'audits',
'type' => 'post', 'action' => 'indexsln'));
echo $form->select('endpoint_id',$options);//,null,null,false);
echo $form->submit('ok');
echo $form->end(); ?>

audits_controllers :

function indexsln(){
$id = $this->data['Audit']['endpoint_id'];
echo $id; //$sln;

$this->set('audits',$this->Audit->query(
"SELECT * FROM audits,endpoints WHERE 
endpoint_id
in
(SELECT id FROM endpoints WHERE sln in
(SELECT sln FROM endpoints WHERE id = ".$id."))
AND audits.endpoint_id = endpoints.id "));

$data=$this->paginate($this->Audit->read());
}



indexsln.ctp :




counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out
of %count% total, starting on record %start%, ending on %end%', true)
));
?>


sort('id');?>
sort('endpoint_id');
?>
sort('day');
echo $paginator->sort('date');?>
sort('author');?>
sort('description');?>
sort('action');?>
sort('visible');?>



>

  // line 32



debuger result example:

[viewVars] => Array
(
[audits] => Array
(
[0] => Array
(
[audits] => Array
(
[id] => 6
[endpoint_id] => 12
[ton_id] =>
[day] => 2010-01-16
[created] => 2010-01-16 20:40:28
[author] => Ktos
[trid] => 123444
[description] => Did Something
[action] => Change
[visible] => 0
)

[endpoints] => Array
(
[id] => 12
[ton_id] => 1
[name] => RU22005-RDFSWQ990099
[sln] => RU22005
[fga] =>
[date] => 2009-11-29 01:39:00
[push] => Success
[activation] => Success
[created] => 2009-11-29 01:43:00
[modified] => 2009-11-29 01:43:00
[col1] => k
[col2] => k
[col3] => k
[col4] =>
[col5] =>
[col6] =>
[col7] =>
[col8] =>
[col9] =>
)

)




i have the same code as indexsln.ctp in other function when i'm
sending data using fndAllBy - it's all ok then.
dubuger seems to be ok in both cases.


Can you please point out what i'm doing wrong?

thx

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


How I can add USE INDEX() find() method

2010-03-31 Thread max
Hello
I want force use mysql multiple-field index.
Mysql don't use multiple-field index in my query.
How I can add USE INDEX to the Model->find() method?

After call Model->find() method
Cakephp executed this query
SELECT * FROM `table` where a=1 AND b>2 ORDER BY b

How I can add USE INDEX into query?
It must be so:
SELECT * FROM `table` USE INDEX(two_field_multiple_index) where a=1
AND b>2 ORDER BY b

Thanks.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


My problem solved :)

2010-03-31 Thread Michel Kogan
my problem solved just by adding this line before class definition:

App::import('Behavior','Tree');

thanks :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Class 'TreeBehavior' not found

2010-03-31 Thread Michel Kogan
when class GroupTreeBehavior extending class TreeBehavior, I got this
error:

[quote]
Fatal error: Class 'TreeBehavior' not found in /var/www/cakephp/app/
models/behaviors/group_tree.php on line 2
[/quote]

line 2 is:

[code]
class GroupTreeBehavior extends TreeBehavior
[/code]

what's the problem ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Set class help needed

2010-03-31 Thread Dr. Loboto
If you pass "fields" option to find("list") as described for grouping
- this will do all the magic.

On Mar 31, 3:13 pm, WebbedIT  wrote:
> Does the form helper automagically create select lists with OPTGROUPS?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Help! Files being read from wrong directory

2010-03-31 Thread Dr. Loboto
Clear Cake caches. This may occur if you copy temps from one install
to another.

On Mar 31, 7:44 pm, TobyG  wrote:
> Hi there,
>
> Hope someone can help, as I've just spent the last 2.5 hrs trying to
> track down the cause of this problem, without any success.
>
> I have a cakePHP application happily running in it's own subdirectory
> on our shared hosting server, & I have frequently used an alternative
> subdirectory to upload a test version of the app to ensure all is OK
> on the live server before I updated the live site.
>
> My problem is (& not sure if this occurred previously, as didn't
> receive this kind of error) that my site appears to be reading the
> controller files in from the wrong subdirectory.  I'm not sure how
> this is happening, as there as I can't find any kind of hard coding of
> the directory anywhere.
>
> I have tried to read through the CakePHP code to try to diagnose the
> problem & have got as far as the App::__mapped() function is returning
> the wrong path, which it gets from the App::__map property, however I
> can't, for the life of me, find where this is populated, so I'm at an
> apparent deadend.
>
> Please can someone help me with this?
>
> Thanks,
>
> T

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Further Datasource documentation

2010-03-31 Thread Lucca Mordente
Not yet! I stopped to work on that for a while...
However, I shall release it as soon as it get good!
Lucca Mordente


On Wed, Mar 31, 2010 at 2:09 AM, alan  wrote:

> Did you ever build the datasource?  Want to release it on cakeforge or
> here?
>
> On Mar 18, 8:56 pm, Lucca Mordente  wrote:
> > Thanks Marco!
> > I'll take a deeper look soon!
> >
> > Cheers,
> > Lucca Mordente
> >
> >
> >
> > On Thu, Mar 18, 2010 at 10:46 PM, Marco  wrote:
> > > What helped me was:
> >
> > >http://www.neilcrookes.com/2009/01/30/cakephp-site-search-with-yahoo-.
> ..
> >
> > > Marco
> >
> > > On Mar 18, 9:09 pm, Lucca Mordente  wrote:
> > > > Hello there,
> >
> > > > I've been trying to create a Datasource for Google Picasa, thought
> the
> > > > documentation about this is too poor.
> >
> > > > Does anyone know where can I find more docs about how to implement
> > > > CakePHP Datasources?
> >
> > > > Cheers,
> > > > Lucca Mordente
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com
> For more options, visit this
> group at
> > >http://groups.google.com/group/cake-php?hl=en
> >
> > > To unsubscribe from this group, send email to cake-php+
> > > unsubscribegooglegroups.com or reply to this email with the words
> "REMOVE
> > > ME" as the subject.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
> To unsubscribe, reply using "remove me" as the subject.
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cake 1.2.6 - Can't bake anything

2010-03-31 Thread Jay Childers
Yes it is.  I have other apps not using cakephp that connect to this server
correctly.

On Wed, Mar 31, 2010 at 8:36 AM, Christian Leskowsky <
christian.leskow...@gmail.com> wrote:

> Is a sql server driver included as part of a stock php install?
>
>
> On Wed, Mar 31, 2010 at 9:06 AM, Jay Childers  wrote:
>
>> > class DATABASE_CONFIG {
>>
>> var $default = array(
>>  'driver' => 'mssql',
>>  'persistent' => false,
>> 'host' => 'xxx',
>>  'port' => 1433,
>> 'login' => 'xxx',
>>  'password' => '',
>> 'database' => 'x',
>>  );
>> }
>> ?>
>>
>> On Wed, Mar 31, 2010 at 7:18 AM, Jeremy Burns  wrote:
>>
>>> Is it worth posting your database configuration file (with username,
>>> password and server details obscured)?
>>>
>>> Jeremy Burns
>>> jeremybu...@me.com
>>>
>>>
>>> On 31 Mar 2010, at 13:17, Jay Childers wrote:
>>>
>>> > The connection parameters are solid, the authenticAtion is solid, and
>>> theserver def. Receives remote requests. This is more a problem with the
>>> bake application itself.
>>> >
>>> > Sent from my iPhone
>>> >
>>> > On Mar 31, 2010, at 6:44 AM, Jonathon Musters 
>>> wrote:
>>> >
>>> >> I would start with the connection string. Making sure that the
>>> >> user/password has access and that even sql will allow remote
>>> >> connection by ip (tcp/ip) and named pipe
>>> >>
>>> >>
>>> >>
>>> >> On 3/30/10, Ed Propsner  wrote:
>>> >>> Just checking ... I'm new to Cake as well but seen it happen all too
>>> many
>>> >>> times with different apps where someone accidentally picks the wrong
>>> server
>>> >>> type.
>>> >>>
>>> >>> On Tue, Mar 30, 2010 at 11:48 PM, Jay Childers 
>>> wrote:
>>> >>>
>>>  I'm using IIS and MSSQL for my servers.
>>> 
>>> 
>>>  On Tue, Mar 30, 2010 at 8:39 PM, Ed Propsner 
>>> wrote:
>>> 
>>> > Are you meaning to use Microsoft SQL server or MYSQL ?
>>> >
>>> >
>>> > On Tue, Mar 30, 2010 at 2:53 PM, McFrosty 
>>> wrote:
>>> >
>>> >> So, I'm new to Cake...that being said, I followed all the
>>> directions
>>> >> and went through the blog tutorial, so I have a tender grasp of
>>> how
>>> >> it's supposed to work.
>>> >>
>>> >> I tried baking my first application today and have met with
>>> nothing
>>> >> but failure.  While I was able to set up the console without any
>>> >> errors, and I was able to bake the project and set up the database
>>> >> correctly, anytime I tried to bake the models or run 'bake all' I
>>> was
>>> >> met with:
>>> >>
>>> >> Bake All
>>> >> ---
>>> >> PHP Warning:  mssql_connect(): Unable to connect: SQL Server is
>>> >> unavailable or d
>>> >> oes not exist.  Connection is busy. (severity 9) in
>>> C:\Inetpub\wwwroot
>>> >> \cake12\ca
>>> >> ke\libs\model\datasources\dbo\dbo_mssql.php on line 144
>>> >>
>>> >> Warning: mssql_connect(): Unable to connect: SQL Server is
>>> unavailable
>>> >> or does n
>>> >> ot exist.  Connection is busy. (severity 9) in C:\Inetpub\wwwroot
>>> >> \cake12\cake\li
>>> >> bs\model\datasources\dbo\dbo_mssql.php on line 144
>>> >> PHP Warning:  mssql_connect(): Unable to connect to server:
>>> >> itsql.oar.tamu.edu
>>> >> in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>>> >> \dbo_mssql.php on li
>>> >> ne 144
>>> >>
>>> >> Warning: mssql_connect(): Unable to connect to server:
>>> >> itsql.oar.tamu.edu in C:
>>> >>
>>> \Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo\dbo_mssql.php
>>> >> on line 14
>>> >> 4
>>> >> PHP Warning:  mssql_select_db(): supplied argument is not a valid
>>> MS
>>> >> SQL-Link re
>>> >> source in
>>> C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>>> >> \dbo_mssql.ph
>>> >> p on line 151
>>> >>
>>> >> Warning: mssql_select_db(): supplied argument is not a valid MS
>>> SQL-
>>> >> Link resourc
>>> >> e in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>>> >> \dbo_mssql.php on
>>> >> line 151
>>> >> PHP Warning:  mssql_query(): supplied argument is not a valid MS
>>> SQL-
>>> >> Link resour
>>> >> ce in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>>> >> \dbo_mssql.php on
>>> >> line 175
>>> >>
>>> >> Warning: mssql_query(): supplied argument is not a valid MS
>>> SQL-Link
>>> >> resource in
>>> >> C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>>> >> \dbo_mssql.php on line
>>> >> 175
>>> >> Error: Your database does not have any tables.
>>> >>
>>> >> I see several of these errors on the cakephp forum, with no real
>>> >> answer.  Does anybody have a clue as to what I might be doing
>>> wrong?
>>> >>
>>> >> Check out the new CakePHP Questions site http://cakeqs.org and
>>> help
>>> >> others with their CakePHP related questions.
>>> >>
>>> >> Yo

Help! Files being read from wrong directory

2010-03-31 Thread TobyG
Hi there,

Hope someone can help, as I've just spent the last 2.5 hrs trying to
track down the cause of this problem, without any success.

I have a cakePHP application happily running in it's own subdirectory
on our shared hosting server, & I have frequently used an alternative
subdirectory to upload a test version of the app to ensure all is OK
on the live server before I updated the live site.

My problem is (& not sure if this occurred previously, as didn't
receive this kind of error) that my site appears to be reading the
controller files in from the wrong subdirectory.  I'm not sure how
this is happening, as there as I can't find any kind of hard coding of
the directory anywhere.

I have tried to read through the CakePHP code to try to diagnose the
problem & have got as far as the App::__mapped() function is returning
the wrong path, which it gets from the App::__map property, however I
can't, for the life of me, find where this is populated, so I'm at an
apparent deadend.

Please can someone help me with this?

Thanks,

T

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Cake 1.2.6 - Can't bake anything

2010-03-31 Thread Christian Leskowsky
Is a sql server driver included as part of a stock php install?

On Wed, Mar 31, 2010 at 9:06 AM, Jay Childers  wrote:

>  class DATABASE_CONFIG {
>
> var $default = array(
> 'driver' => 'mssql',
>  'persistent' => false,
> 'host' => 'xxx',
>  'port' => 1433,
> 'login' => 'xxx',
>  'password' => '',
> 'database' => 'x',
>  );
> }
> ?>
>
> On Wed, Mar 31, 2010 at 7:18 AM, Jeremy Burns  wrote:
>
>> Is it worth posting your database configuration file (with username,
>> password and server details obscured)?
>>
>> Jeremy Burns
>> jeremybu...@me.com
>>
>>
>> On 31 Mar 2010, at 13:17, Jay Childers wrote:
>>
>> > The connection parameters are solid, the authenticAtion is solid, and
>> theserver def. Receives remote requests. This is more a problem with the
>> bake application itself.
>> >
>> > Sent from my iPhone
>> >
>> > On Mar 31, 2010, at 6:44 AM, Jonathon Musters 
>> wrote:
>> >
>> >> I would start with the connection string. Making sure that the
>> >> user/password has access and that even sql will allow remote
>> >> connection by ip (tcp/ip) and named pipe
>> >>
>> >>
>> >>
>> >> On 3/30/10, Ed Propsner  wrote:
>> >>> Just checking ... I'm new to Cake as well but seen it happen all too
>> many
>> >>> times with different apps where someone accidentally picks the wrong
>> server
>> >>> type.
>> >>>
>> >>> On Tue, Mar 30, 2010 at 11:48 PM, Jay Childers 
>> wrote:
>> >>>
>>  I'm using IIS and MSSQL for my servers.
>> 
>> 
>>  On Tue, Mar 30, 2010 at 8:39 PM, Ed Propsner 
>> wrote:
>> 
>> > Are you meaning to use Microsoft SQL server or MYSQL ?
>> >
>> >
>> > On Tue, Mar 30, 2010 at 2:53 PM, McFrosty 
>> wrote:
>> >
>> >> So, I'm new to Cake...that being said, I followed all the
>> directions
>> >> and went through the blog tutorial, so I have a tender grasp of how
>> >> it's supposed to work.
>> >>
>> >> I tried baking my first application today and have met with nothing
>> >> but failure.  While I was able to set up the console without any
>> >> errors, and I was able to bake the project and set up the database
>> >> correctly, anytime I tried to bake the models or run 'bake all' I
>> was
>> >> met with:
>> >>
>> >> Bake All
>> >> ---
>> >> PHP Warning:  mssql_connect(): Unable to connect: SQL Server is
>> >> unavailable or d
>> >> oes not exist.  Connection is busy. (severity 9) in
>> C:\Inetpub\wwwroot
>> >> \cake12\ca
>> >> ke\libs\model\datasources\dbo\dbo_mssql.php on line 144
>> >>
>> >> Warning: mssql_connect(): Unable to connect: SQL Server is
>> unavailable
>> >> or does n
>> >> ot exist.  Connection is busy. (severity 9) in C:\Inetpub\wwwroot
>> >> \cake12\cake\li
>> >> bs\model\datasources\dbo\dbo_mssql.php on line 144
>> >> PHP Warning:  mssql_connect(): Unable to connect to server:
>> >> itsql.oar.tamu.edu
>> >> in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>> >> \dbo_mssql.php on li
>> >> ne 144
>> >>
>> >> Warning: mssql_connect(): Unable to connect to server:
>> >> itsql.oar.tamu.edu in C:
>> >>
>> \Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo\dbo_mssql.php
>> >> on line 14
>> >> 4
>> >> PHP Warning:  mssql_select_db(): supplied argument is not a valid
>> MS
>> >> SQL-Link re
>> >> source in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>> >> \dbo_mssql.ph
>> >> p on line 151
>> >>
>> >> Warning: mssql_select_db(): supplied argument is not a valid MS
>> SQL-
>> >> Link resourc
>> >> e in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>> >> \dbo_mssql.php on
>> >> line 151
>> >> PHP Warning:  mssql_query(): supplied argument is not a valid MS
>> SQL-
>> >> Link resour
>> >> ce in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>> >> \dbo_mssql.php on
>> >> line 175
>> >>
>> >> Warning: mssql_query(): supplied argument is not a valid MS
>> SQL-Link
>> >> resource in
>> >> C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>> >> \dbo_mssql.php on line
>> >> 175
>> >> Error: Your database does not have any tables.
>> >>
>> >> I see several of these errors on the cakephp forum, with no real
>> >> answer.  Does anybody have a clue as to what I might be doing
>> wrong?
>> >>
>> >> Check out the new CakePHP Questions site http://cakeqs.org and
>> help
>> >> others with their CakePHP related questions.
>> >>
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "CakePHP" group.
>> >> To post to this group, send email to cake-php@googlegroups.com
>> >> To unsubscribe from this group, send email to
>> >> cake-php+unsubscr...@googlegroups.com
>> 
>> >For
>> >> more options, visit this group at

Re: Cake 1.2.6 - Can't bake anything

2010-03-31 Thread Jay Childers
 'mssql',
 'persistent' => false,
'host' => 'xxx',
 'port' => 1433,
'login' => 'xxx',
 'password' => '',
'database' => 'x',
 );
}
?>

On Wed, Mar 31, 2010 at 7:18 AM, Jeremy Burns  wrote:

> Is it worth posting your database configuration file (with username,
> password and server details obscured)?
>
> Jeremy Burns
> jeremybu...@me.com
>
>
> On 31 Mar 2010, at 13:17, Jay Childers wrote:
>
> > The connection parameters are solid, the authenticAtion is solid, and
> theserver def. Receives remote requests. This is more a problem with the
> bake application itself.
> >
> > Sent from my iPhone
> >
> > On Mar 31, 2010, at 6:44 AM, Jonathon Musters 
> wrote:
> >
> >> I would start with the connection string. Making sure that the
> >> user/password has access and that even sql will allow remote
> >> connection by ip (tcp/ip) and named pipe
> >>
> >>
> >>
> >> On 3/30/10, Ed Propsner  wrote:
> >>> Just checking ... I'm new to Cake as well but seen it happen all too
> many
> >>> times with different apps where someone accidentally picks the wrong
> server
> >>> type.
> >>>
> >>> On Tue, Mar 30, 2010 at 11:48 PM, Jay Childers 
> wrote:
> >>>
>  I'm using IIS and MSSQL for my servers.
> 
> 
>  On Tue, Mar 30, 2010 at 8:39 PM, Ed Propsner 
> wrote:
> 
> > Are you meaning to use Microsoft SQL server or MYSQL ?
> >
> >
> > On Tue, Mar 30, 2010 at 2:53 PM, McFrosty 
> wrote:
> >
> >> So, I'm new to Cake...that being said, I followed all the directions
> >> and went through the blog tutorial, so I have a tender grasp of how
> >> it's supposed to work.
> >>
> >> I tried baking my first application today and have met with nothing
> >> but failure.  While I was able to set up the console without any
> >> errors, and I was able to bake the project and set up the database
> >> correctly, anytime I tried to bake the models or run 'bake all' I
> was
> >> met with:
> >>
> >> Bake All
> >> ---
> >> PHP Warning:  mssql_connect(): Unable to connect: SQL Server is
> >> unavailable or d
> >> oes not exist.  Connection is busy. (severity 9) in
> C:\Inetpub\wwwroot
> >> \cake12\ca
> >> ke\libs\model\datasources\dbo\dbo_mssql.php on line 144
> >>
> >> Warning: mssql_connect(): Unable to connect: SQL Server is
> unavailable
> >> or does n
> >> ot exist.  Connection is busy. (severity 9) in C:\Inetpub\wwwroot
> >> \cake12\cake\li
> >> bs\model\datasources\dbo\dbo_mssql.php on line 144
> >> PHP Warning:  mssql_connect(): Unable to connect to server:
> >> itsql.oar.tamu.edu
> >> in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
> >> \dbo_mssql.php on li
> >> ne 144
> >>
> >> Warning: mssql_connect(): Unable to connect to server:
> >> itsql.oar.tamu.edu in C:
> >>
> \Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo\dbo_mssql.php
> >> on line 14
> >> 4
> >> PHP Warning:  mssql_select_db(): supplied argument is not a valid MS
> >> SQL-Link re
> >> source in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
> >> \dbo_mssql.ph
> >> p on line 151
> >>
> >> Warning: mssql_select_db(): supplied argument is not a valid MS SQL-
> >> Link resourc
> >> e in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
> >> \dbo_mssql.php on
> >> line 151
> >> PHP Warning:  mssql_query(): supplied argument is not a valid MS
> SQL-
> >> Link resour
> >> ce in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
> >> \dbo_mssql.php on
> >> line 175
> >>
> >> Warning: mssql_query(): supplied argument is not a valid MS SQL-Link
> >> resource in
> >> C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
> >> \dbo_mssql.php on line
> >> 175
> >> Error: Your database does not have any tables.
> >>
> >> I see several of these errors on the cakephp forum, with no real
> >> answer.  Does anybody have a clue as to what I might be doing wrong?
> >>
> >> Check out the new CakePHP Questions site http://cakeqs.org and help
> >> others with their CakePHP related questions.
> >>
> >> You received this message because you are subscribed to the Google
> >> Groups
> >> "CakePHP" group.
> >> To post to this group, send email to cake-php@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscr...@googlegroups.com
> 
> >For
> >> more options, visit this group at
> >> http://groups.google.com/group/cake-php?hl=en
> >>
> >> To unsubscribe, reply using "remove me" as the subject.
> >>
> >
> > Check out the new CakePHP Questions site http://cakeqs.org and help
> > others with their CakePHP related questions.
> >
> > You received this message because you are subscribed to the

Re: Cake 1.2.6 - Can't bake anything

2010-03-31 Thread Jeremy Burns
Is it worth posting your database configuration file (with username, password 
and server details obscured)?

Jeremy Burns
jeremybu...@me.com


On 31 Mar 2010, at 13:17, Jay Childers wrote:

> The connection parameters are solid, the authenticAtion is solid, and 
> theserver def. Receives remote requests. This is more a problem with the bake 
> application itself.
> 
> Sent from my iPhone
> 
> On Mar 31, 2010, at 6:44 AM, Jonathon Musters  wrote:
> 
>> I would start with the connection string. Making sure that the
>> user/password has access and that even sql will allow remote
>> connection by ip (tcp/ip) and named pipe
>> 
>> 
>> 
>> On 3/30/10, Ed Propsner  wrote:
>>> Just checking ... I'm new to Cake as well but seen it happen all too many
>>> times with different apps where someone accidentally picks the wrong server
>>> type.
>>> 
>>> On Tue, Mar 30, 2010 at 11:48 PM, Jay Childers  wrote:
>>> 
 I'm using IIS and MSSQL for my servers.
 
 
 On Tue, Mar 30, 2010 at 8:39 PM, Ed Propsner  wrote:
 
> Are you meaning to use Microsoft SQL server or MYSQL ?
> 
> 
> On Tue, Mar 30, 2010 at 2:53 PM, McFrosty  wrote:
> 
>> So, I'm new to Cake...that being said, I followed all the directions
>> and went through the blog tutorial, so I have a tender grasp of how
>> it's supposed to work.
>> 
>> I tried baking my first application today and have met with nothing
>> but failure.  While I was able to set up the console without any
>> errors, and I was able to bake the project and set up the database
>> correctly, anytime I tried to bake the models or run 'bake all' I was
>> met with:
>> 
>> Bake All
>> ---
>> PHP Warning:  mssql_connect(): Unable to connect: SQL Server is
>> unavailable or d
>> oes not exist.  Connection is busy. (severity 9) in C:\Inetpub\wwwroot
>> \cake12\ca
>> ke\libs\model\datasources\dbo\dbo_mssql.php on line 144
>> 
>> Warning: mssql_connect(): Unable to connect: SQL Server is unavailable
>> or does n
>> ot exist.  Connection is busy. (severity 9) in C:\Inetpub\wwwroot
>> \cake12\cake\li
>> bs\model\datasources\dbo\dbo_mssql.php on line 144
>> PHP Warning:  mssql_connect(): Unable to connect to server:
>> itsql.oar.tamu.edu
>> in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>> \dbo_mssql.php on li
>> ne 144
>> 
>> Warning: mssql_connect(): Unable to connect to server:
>> itsql.oar.tamu.edu in C:
>> \Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo\dbo_mssql.php
>> on line 14
>> 4
>> PHP Warning:  mssql_select_db(): supplied argument is not a valid MS
>> SQL-Link re
>> source in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>> \dbo_mssql.ph
>> p on line 151
>> 
>> Warning: mssql_select_db(): supplied argument is not a valid MS SQL-
>> Link resourc
>> e in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>> \dbo_mssql.php on
>> line 151
>> PHP Warning:  mssql_query(): supplied argument is not a valid MS SQL-
>> Link resour
>> ce in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>> \dbo_mssql.php on
>> line 175
>> 
>> Warning: mssql_query(): supplied argument is not a valid MS SQL-Link
>> resource in
>> C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
>> \dbo_mssql.php on line
>> 175
>> Error: Your database does not have any tables.
>> 
>> I see several of these errors on the cakephp forum, with no real
>> answer.  Does anybody have a clue as to what I might be doing wrong?
>> 
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>> 
>> You received this message because you are subscribed to the Google
>> Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>> more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>> 
>> To unsubscribe, reply using "remove me" as the subject.
>> 
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
> more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
> 
 
 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.
 
 You rec

Re: Cake 1.2.6 - Can't bake anything

2010-03-31 Thread Jay Childers
The connection parameters are solid, the authenticAtion is solid, and  
theserver def. Receives remote requests. This is more a problem with  
the bake application itself.


Sent from my iPhone

On Mar 31, 2010, at 6:44 AM, Jonathon Musters   
wrote:



I would start with the connection string. Making sure that the
user/password has access and that even sql will allow remote
connection by ip (tcp/ip) and named pipe



On 3/30/10, Ed Propsner  wrote:
Just checking ... I'm new to Cake as well but seen it happen all  
too many
times with different apps where someone accidentally picks the  
wrong server

type.

On Tue, Mar 30, 2010 at 11:48 PM, Jay Childers   
wrote:



I'm using IIS and MSSQL for my servers.


On Tue, Mar 30, 2010 at 8:39 PM, Ed Propsner  
 wrote:



Are you meaning to use Microsoft SQL server or MYSQL ?


On Tue, Mar 30, 2010 at 2:53 PM, McFrosty   
wrote:


So, I'm new to Cake...that being said, I followed all the  
directions
and went through the blog tutorial, so I have a tender grasp of  
how

it's supposed to work.

I tried baking my first application today and have met with  
nothing

but failure.  While I was able to set up the console without any
errors, and I was able to bake the project and set up the database
correctly, anytime I tried to bake the models or run 'bake all'  
I was

met with:

Bake All
---
PHP Warning:  mssql_connect(): Unable to connect: SQL Server is
unavailable or d
oes not exist.  Connection is busy. (severity 9) in C:\Inetpub 
\wwwroot

\cake12\ca
ke\libs\model\datasources\dbo\dbo_mssql.php on line 144

Warning: mssql_connect(): Unable to connect: SQL Server is  
unavailable

or does n
ot exist.  Connection is busy. (severity 9) in C:\Inetpub\wwwroot
\cake12\cake\li
bs\model\datasources\dbo\dbo_mssql.php on line 144
PHP Warning:  mssql_connect(): Unable to connect to server:
itsql.oar.tamu.edu
in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
\dbo_mssql.php on li
ne 144

Warning: mssql_connect(): Unable to connect to server:
itsql.oar.tamu.edu in C:
\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo 
\dbo_mssql.php

on line 14
4
PHP Warning:  mssql_select_db(): supplied argument is not a  
valid MS

SQL-Link re
source in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources 
\dbo

\dbo_mssql.ph
p on line 151

Warning: mssql_select_db(): supplied argument is not a valid MS  
SQL-

Link resourc
e in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
\dbo_mssql.php on
line 151
PHP Warning:  mssql_query(): supplied argument is not a valid MS  
SQL-

Link resour
ce in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
\dbo_mssql.php on
line 175

Warning: mssql_query(): supplied argument is not a valid MS SQL- 
Link

resource in
C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
\dbo_mssql.php on line
175
Error: Your database does not have any tables.

I see several of these errors on the cakephp forum, with no real
answer.  Does anybody have a clue as to what I might be doing  
wrong?


Check out the new CakePHP Questions site http://cakeqs.org and  
help

others with their CakePHP related questions.

You received this message because you are subscribed to the Google
Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com%2bunsubscr...@googlegroups.com>For

more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.



Check out the new CakePHP Questions site http://cakeqs.org and help
others with their CakePHP related questions.

You received this message because you are subscribed to the  
Google Groups

"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com%2bunsubscr...@googlegroups.com>For

more options, visit this group at
http://groups.google.com/group/cake-php?hl=en



Check out the new CakePHP Questions site http://cakeqs.org and help
others with their CakePHP related questions.

You received this message because you are subscribed to the Google  
Groups

"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com%2bunsubscr...@googlegroups.com>For

more options, visit this group at
http://groups.google.com/group/cake-php?hl=en



Check out the new CakePHP Questions site http://cakeqs.org and help  
others

with their CakePHP related questions.

You received this message because you are subscribed to the Google  
Groups

"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this  
group at

http://groups.google.com/group/cake-php?hl

Re: Cake 1.2.6 - Can't bake anything

2010-03-31 Thread Jonathon Musters
I would start with the connection string. Making sure that the
user/password has access and that even sql will allow remote
connection by ip (tcp/ip) and named pipe



On 3/30/10, Ed Propsner  wrote:
> Just checking ... I'm new to Cake as well but seen it happen all too many
> times with different apps where someone accidentally picks the wrong server
> type.
>
> On Tue, Mar 30, 2010 at 11:48 PM, Jay Childers  wrote:
>
>> I'm using IIS and MSSQL for my servers.
>>
>>
>> On Tue, Mar 30, 2010 at 8:39 PM, Ed Propsner  wrote:
>>
>>> Are you meaning to use Microsoft SQL server or MYSQL ?
>>>
>>>
>>> On Tue, Mar 30, 2010 at 2:53 PM, McFrosty  wrote:
>>>
 So, I'm new to Cake...that being said, I followed all the directions
 and went through the blog tutorial, so I have a tender grasp of how
 it's supposed to work.

 I tried baking my first application today and have met with nothing
 but failure.  While I was able to set up the console without any
 errors, and I was able to bake the project and set up the database
 correctly, anytime I tried to bake the models or run 'bake all' I was
 met with:

 Bake All
 ---
 PHP Warning:  mssql_connect(): Unable to connect: SQL Server is
 unavailable or d
 oes not exist.  Connection is busy. (severity 9) in C:\Inetpub\wwwroot
 \cake12\ca
 ke\libs\model\datasources\dbo\dbo_mssql.php on line 144

 Warning: mssql_connect(): Unable to connect: SQL Server is unavailable
 or does n
 ot exist.  Connection is busy. (severity 9) in C:\Inetpub\wwwroot
 \cake12\cake\li
 bs\model\datasources\dbo\dbo_mssql.php on line 144
 PHP Warning:  mssql_connect(): Unable to connect to server:
 itsql.oar.tamu.edu
 in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
 \dbo_mssql.php on li
 ne 144

 Warning: mssql_connect(): Unable to connect to server:
 itsql.oar.tamu.edu in C:
 \Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo\dbo_mssql.php
 on line 14
 4
 PHP Warning:  mssql_select_db(): supplied argument is not a valid MS
 SQL-Link re
 source in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
 \dbo_mssql.ph
 p on line 151

 Warning: mssql_select_db(): supplied argument is not a valid MS SQL-
 Link resourc
 e in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
 \dbo_mssql.php on
 line 151
 PHP Warning:  mssql_query(): supplied argument is not a valid MS SQL-
 Link resour
 ce in C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
 \dbo_mssql.php on
  line 175

 Warning: mssql_query(): supplied argument is not a valid MS SQL-Link
 resource in
  C:\Inetpub\wwwroot\cake12\cake\libs\model\datasources\dbo
 \dbo_mssql.php on line
  175
 Error: Your database does not have any tables.

 I see several of these errors on the cakephp forum, with no real
 answer.  Does anybody have a clue as to what I might be doing wrong?

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 You received this message because you are subscribed to the Google
 Groups
 "CakePHP" group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comFor
 more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 To unsubscribe, reply using "remove me" as the subject.

>>>
>>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.comFor
>>> more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>> more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For mo

Re: Validating not in list

2010-03-31 Thread moos3

What you are going to want to is this,in your add or create cunstion
add this bit of code:
$nicknames=array('mike','gizmo','root');
if (in_array($this->data['User']['username'],$nicknames)){
 $this->Session->setFlash('nickname is reserved please try another
one', 'default', array('class'=>'bad');
}
On Mar 30, 3:19 pm, Bart  wrote:
> Hello,
>
> I'm trying to build an application that is User based.
> However, I want to reserve some nicknames so you can't register them.
>
> When going over the validation rules, I 
> findhttp://book.cakephp.org/view/1171/inList
> Which is basically what I need, but negated.
>
> Is there a way to say something like "not inList". Or just any way to
> negate that statement?
> Or should I just define a function for it?
>
> Thanks,
> Bart

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Retrieving objects from the DB instead of arrays

2010-03-31 Thread Christian Leskowsky
The cookbook is really comprehensive. The content isn't always where I'd
expect it to be but I found reading it from top to bottom several times very
helpful.

Beyond that I'd say just start building your project and structure it the
way you want within the confines of Cakely convention. Your 2nd app will be
better then the 1st because you slogged through the framework on your own.
3rd, 4th, and 5th even better still!

There's no avoiding that initial bump of frustration and hair pulling one
goes through learning a new framework I'm afraid. :-]

Good luck.

On Wed, Mar 31, 2010 at 1:29 AM, paws_galuten wrote:

> Thanks for all of the helpful responses. It makes sense, but I feel
> like I'm shooting in the dark when it comes to learning cake. I do, in
> fact, have a fat controller and a thin model. I would really like to
> see some simple example apps, or a tutorial that does a little more
> than the blog. I guess I just have to keep trying things and asking
> questions, but I don't know where one goes to learn the conventions.
>
> Thanks,
> Jason
>
>
> On Mar 30, 9:54 pm, Walther  wrote:
> > If you are manipulating data in your controller then your 'doing it
> > wrong'.
> >
> > 'GoodCake' is to have the bulk of your code in your models (Fat model,
> > thin controller), the controller should almost only call the correct
> > model methods (And perform things like authorisation, authentication,
> > session management, etc.).
> >
> > You should also take a look at the new virtualFields in CakePHP 1.3.
> > This allows you to easily use sql snippets as if they were real fields
> > (Something like YEAR(NOW()) - YEAR(Person.birthday) as age) .
> >
> > If you have any queries come join the IRC channel
> >
> > On Mar 31, 6:31 am, Jamie  wrote:
> >
> >
> >
> > > I'm afraid that there's no satisfying answer for you. Cake doesn't map
> > > DB records to objects; arrays are all you're gonna get. If you want
> > > your data in objects instead of arrays, then you'll have to rework a
> > > substantial part of the Cake core. You're stuck with arrays unless you
> > > want to do some serious, serious work. ;)
> >
> > > As Andy mentioned, you can use Model callbacks - especially afterFind
> > > - to format your data. You can also write helpers to accomplish a lot
> > > of the dirty work. So, instead of $person->getAge(), you might have
> > > $formatter->getAge($person['Person']['birthday']) where "$formatter"
> > > is FormatterHelper and getAge() is a function that takes a date and
> > > converts it to an age. For helpers:
> >
> > >http://book.cakephp.org/view/1095/Helpers
> >
> > > Hope that helps.
> >
> > > - Jamie
> >
> > > On Mar 30, 8:31 pm, paws_galuten  wrote:
> >
> > > > I'm new to cakePHP and it seems like the only way to retrieve data
> > > > from the data source is as an array. I'm finding that I am using a
> lot
> > > > of code in my controller to prepare the arrays for display in the
> > > > view, when I would rather be able to send an object to the view and
> > > > get data from that object.
> >
> > > > For example, if I had a person object, I could have an attribute that
> > > > was their birthdate and in the view I could easily get their age with
> > > > something like $person->getAge(). If I only have the person as an
> > > > array, then I have to do the calculating of the age before I can
> > > > display it.
> >
> > > > Does this make sense? It is a simplistic example, but I can see
> myself
> > > > having to write a lot of code to manipulate arrays before the raw
> > > > database data is usable.
> >
> > > > Thanks for your insights,
> > > > Jason
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
> To unsubscribe, reply using "remove me" as the subject.
>



-- 
-

"You can't reason people out of a position they didn't use reason to get
into."

Christian Leskowsky

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Multiple Table-Model, Multiple DB

2010-03-31 Thread Jeremy Burns
No worries. Sounds like your database needs tuning (indexes etc). I'd look 
there first. I'd also examine what data you are querying to make sure you are 
not retrieving unnecessary data. If you are going to go the Cake route (which 
I'd highly recommend) then I'd encourage you to look at these sections of the 
book for starters:

http://book.cakephp.org/view/1039/Associations-Linking-Models-Together
http://book.cakephp.org/view/1323/Containable
http://book.cakephp.org/view/1017/Retrieving-Your-Data

Jeremy Burns
jeremybu...@me.com
(Skype) +44 208 123 3822 (jeremy_burns)
(m) +44 7973 481949
(h) +44 208 530 7573

On 31 Mar 2010, at 11:07, cupidoly wrote:

> Jeremy Burns,
> 
> I truly salute you for such a detailed explanation. Actually, I always
> prefer RDBMS. I just wanted to try a new concept. I have already
> mentioned that this is just a concept, nothing into implementation. We
> are just brainstorming. Our boss likes any new idea, let it be
> bullshit. He later decides what suits the best.
> 
> I personally think sometimes it's better to make mistakes and learn.
> 
> My concept I talked about, actually came from another project that I'm
> maintaining right now. The project was build few months ago by someone
> else, and it has few thousands of members now. Gradually as the
> members grew, their data about their activities grew exponentially.
> Now the activities tables has few millions of rows. Initially the site
> was giving very good performance, but now, its super slow. Our team
> found out that mysql is the bottleneck. Now we have decided to build
> our projects in-house rather than outsourcing. So we're just
> brainstorming what could be a good solution for us. I know we can use
> RDBMS with MySQL Cluster, or even NoSQL with MongoDB or many other
> solutions are out there. Initially, I just thought this will be a
> cheap option to go with. Later on, I just understood my mistake.
> 
> Thank you very much for your time.
> 
> NB - Please forgive my poor english, as i'm not a native english
> speaker.
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
> 
> To unsubscribe, reply using "remove me" as the subject.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Multiple Table-Model, Multiple DB

2010-03-31 Thread cupidoly
Jeremy Burns,

I truly salute you for such a detailed explanation. Actually, I always
prefer RDBMS. I just wanted to try a new concept. I have already
mentioned that this is just a concept, nothing into implementation. We
are just brainstorming. Our boss likes any new idea, let it be
bullshit. He later decides what suits the best.

I personally think sometimes it's better to make mistakes and learn.

My concept I talked about, actually came from another project that I'm
maintaining right now. The project was build few months ago by someone
else, and it has few thousands of members now. Gradually as the
members grew, their data about their activities grew exponentially.
Now the activities tables has few millions of rows. Initially the site
was giving very good performance, but now, its super slow. Our team
found out that mysql is the bottleneck. Now we have decided to build
our projects in-house rather than outsourcing. So we're just
brainstorming what could be a good solution for us. I know we can use
RDBMS with MySQL Cluster, or even NoSQL with MongoDB or many other
solutions are out there. Initially, I just thought this will be a
cheap option to go with. Later on, I just understood my mistake.

Thank you very much for your time.

NB - Please forgive my poor english, as i'm not a native english
speaker.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Associated model not returning all data

2010-03-31 Thread WhyNotSmile
Thanks John, that solved it!

On Mar 30, 4:43 pm, John Andersen  wrote:
> Check your name of the BannedUser model filename, should be
> banned_user.php!
> Enjoy,
>    John
>
> On Mar 30, 4:28 pm, WhyNotSmile 
> wrote:
>
> > I have 3 models in my app:
> >  Group
> >  Users
> >  Banned Users
>
> > Each of the Users and Banned Users belong to a group (or used to, in
> > the case of banned users), so they both have  a field called group_id.
>
> > When I paginate the Users, I get a list of users, including their
> > group.
>
> > When I do the same thing for Banned Users, I don't get their group
> > information.
>
> > Here's what I have in my models:
>
> > class Group extends AppModel {
> >  var $name = 'Group';
> >  var $hasMany = array(
> >                'User' => array(
> >                            'className' => 'User',
> >                            'foreignKey' => 'group_id',
> >                            'dependent'=> false
> >                           ),
> >                'BannedUser' => array(
> >                            'className' => 'BannedUser',
> >                            'foreignKey' => 'group_id',
> >                            'dependent'=> false
> >                           )
> >                 );
>
> > }
>
> > class User extends AppModel {
> >  var $name = 'User';
> >  var $belongsTo = 'Group';
>
> > }
>
> > class BannedUser extends AppModel
> >  var $name = 'BannedUser';
> >  var $belongsTo = 'Group';
>
> > }
>
> > In the controller (which includes both of the above in $uses), I have:
>
> > $this->User->recursive = 1;
> > $userlist = $this->paginate('User');
>
> > $this->BannedUser->recursive = 1;
> > $userlist = $this->paginate('BannedUser');
>
> > The first one returns Group info, the second doesn't.  Can anyone see
> > what I'm doing wrong?  Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: Set class help needed

2010-03-31 Thread WebbedIT
Does the form helper automagically create select lists with OPTGROUPS?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.


Re: problem with TinyMCE under debug mode

2010-03-31 Thread WebbedIT
Are you using something like Firebug and if so is it showing any
errors in the console?

I'm using TinyMCE without issue, to compare your setup to mine you can
read my blog entry:
http://webbedit.co.uk/blog_posts/view/tinymce-cakephp-mcimagemanager-mcfilemanager

HTH

Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.