Re: Stored Procedure Parameters
Thank you for fully understanding the question. It is very difficult to look up the source for a function that does not exist. I wouldn't even know where to start. Cory On Oct 4, 9:10 pm, Grant Cox <[EMAIL PROTECTED]> wrote: > I didn't answer Cory because I didn't know the answer - it's a > behaviour of Cake that I've never really understood. > > When you request a model function that doesn't exist (ie > $this->MyModel->do_some_stuff() ), then "do_some_stuff" is attempted to be > > executed as SQL. I've never used stored procedures, so this > invariably has just thrown an SQL error and I realised I made a > mistake. > > However, surely this functionality has been implemented with a > purpose, and I now assume this is to execute stored procedures as > model functions (sounds pretty cool). Cory is obviously finding it > difficult to find how to actually pass data to this stored procedure. > > Cory - your options are: > 1. Use $this->MyModel->query("do_some_stuff( param1 param2)") or > however you would normally execute the stored procedure directly > through SQL. > 2. Look in the API to find how a missing model function is > automatically parsed into a SQL call - perhaps there is some way of > passing parameters. > 3. Get on IRC, and talk to either Nate or PHPNut about this - they > should know what the real functionality is meant to be. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Stored Procedure Parameters
Bump? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Stored Procedure Parameters
A friend told me about how you can call a stored procedure simply by calling $this->stored_proc_name(), this works well, but I can't seem to figure out the syntax it expects the parameters to be passed in in. It doesn't want to take an array of key/values, and it doesn't want just the data with no var names, and it doesn't seem to want a "var=x" type of string either. Any ideas? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Missing adodb.inc.php File?
Thanks PHPNut. That cleared up the problem right away. Now I just have to figure out the 2 new errors I get :D On Oct 1, 7:29 am, "Larry E. Masters aka PhpNut" <[EMAIL PROTECTED]> wrote: > That file is not part of the CakePHP core, it is part of the adodb > distribution. You must install this library in app/vendors > > -- > /** > * @author Larry E. Masters > * @var string $userName > * @param string $realName > * @returns string aka PhpNut > * @access public > */ > > On 10/1/07, Cory Dee <[EMAIL PROTECTED]> wrote: > > > > > No one has ever experienced this before? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Missing adodb.inc.php File?
No one has ever experienced this before? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Missing adodb.inc.php File?
Apparantly, when I installed Cake, an include file was missed. Error as follows: Warning: vendor(E:\Sites\OPL\2008\cake\vendors\adodb\adodb.inc.php): failed to open stream: No such file or directory in E:\Sites\OPL \2008\cake\cake\basics.php on line 536 Fatal error: vendor(): Failed opening required 'E:\Sites\OPL\2008\cake \vendors\adodb\adodb.inc.php' (include_path='E:\Sites\OPL\2008\cake;E: \Sites\OPL\2008\cake\app\;.;D:\PHP\pear') in E:\Sites\OPL\2008\cake \cake\basics.php on line 536 adodb.inc.php does not exist anywhere inside of cake, and the paths are all wonky as cake\vendors doesn't exist for the file even to be in the folder. Googling this doesn't seem to return many answers, and the same goes for bake and the api. Has anyone run into this before? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Starting with Non-Standard DB Conventions
Ahhh, thank you so much! On Sep 28, 9:06 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 9/28/07, Cory Dee <[EMAIL PROTECTED]> wrote: > > > > > I had a feeling that there was going to be an "easier" way to do > > things. > > > The problem is, is that I'm not aware of any way to specify the > > table's name. The below code still returns "No Database table for > > model Book (expected "books"), create it first.", as the table is > > called "bib", rather than "books", as the framework is expecting. > > You can override any of the conventions that Cake uses for the models > including the name of the table. > > var $useTable = 'LegacyTableName'; > > Hope that helps. > > -- > Chris Hartjes > Senior Developer > Cake Development Corporationhttp://www.cakedevelopment.com > > My motto for 2007: "Just build it, damnit!" > > @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Starting with Non-Standard DB Conventions
I had a feeling that there was going to be an "easier" way to do things. The problem is, is that I'm not aware of any way to specify the table's name. The below code still returns "No Database table for model Book (expected "books"), create it first.", as the table is called "bib", rather than "books", as the framework is expecting. Cory On Sep 27, 2:00 pm, robechar <[EMAIL PROTECTED]> wrote: > So to directly answer your question, in you getBibNum() function, I > would use the built in field() function instead of query() and pass it > some conditions: > > function getBibNum($isbn) > { > $conditions = array("`Book`.`tag`='020'", > "`Book`.`text` LIKE '% > {$isbn}%'"); > return $this->field('bib_number', $conditions); > } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Starting with Non-Standard DB Conventions
Disclaimer: I am very new to Cake I havn't had much success searching for examples and tutorials using the query() function, so I tried to stumble through it with the info I did have at hand. If someone could point out the errors of my ways, that'd be awesome. Basically, I'm connecting to the DB used by a desktop app we license from a vendor, so of course, it's not setup in the way Cake would like it to be. What I am trying to do is something like this: Model: query("SELECT [bib#] FROM [bib] WHERE [tag] = '020' AND [text] LIKE '%" . $isbn . "%'"); $bibNum = $ret[0]['bib#']; return $bibNum; } } ?> Controller: set('posts',$this->Post->findAll()); $this->set('book', $this->Book->getBibNum("0670063622")); } } ?> View: ", $post['Book']['bib#'])?> Obviously this is a low level sample, to get me going in the right direction. Again, tips are appreciated. Cory --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---