Join Tables in Cake

2009-03-24 Thread smithtrev...@googlemail.com
Hi, I have a database with a join table that connects 3 tables together to create one join table. This join table then connects to another join table. After baking the models, controllers and views, and trying to view in a browser, I get this error. When i try and view my manager view.

Re: Join Tables in Cake

2009-03-24 Thread smithtrev...@googlemail.com
This is the model. I don't really want to change it to ignore the conventions. I'd rather sort the problem. array( 'className' => 'SeasonsTeam', 'joinTable' => 'managers_seasons_teams', 'foreignKey' => 'season_id',

XML parsing

2009-04-07 Thread smithtrev...@googlemail.com
Hello, I need to fill a table in my database, called teams, with the data contained in this XML file, both the team IDs and the team names. However, I am struggling to do so. ArsenalAston VillaBlackburn RoversBolton WanderersChelseaEvertonFulhamHull CityLiverpoolManchester CityMancheste

Re: XML parsing

2009-04-09 Thread smithtrev...@googlemail.com
Thanks for your help. I've been using this code and I think it's sort of worked. function index() { App::import('Xml'); $file = "http://localhost\parses\y.xml";; $parsed_xml =& new XML($file); $parsed_xml = Set::reverse($parsed_xml); // this is what i call magic debug($pars

Re: XML parsing

2009-04-09 Thread smithtrev...@googlemail.com
If your source file is invalid you could use the SimpleHTMLDom class I > suggested. It accepts invalid HTML/XML and is quite easy to work with. > > //mathias > > 2009/4/9 smithtrev...@googlemail.com : > > > > > Thanks for your help. I've been using this code and I

Re: XML parsing

2009-04-09 Thread smithtrev...@googlemail.com
Ok, I've managed to do it by using the XML file directly from the website, and not using a local copy. This is definitely much better. Thanks for your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" gr

Re: XML parsing

2009-04-09 Thread smithtrev...@googlemail.com
Ok, now I've done that, I've spent the last couple of hours trying to insert the parsed xml into a database table called teams. However, I am struggling to do so. I've had a few tries using a number of different methods. http://abeautifulsite.net/notebook/42 http://www.codewalkers.com/c/a/Databa

Re: XML parsing

2009-04-16 Thread smithtrev...@googlemail.com
Thanks for your help mxcdex. It all is working fine, except the line: $success = $this->Team->saveAll($xml['Teams']); This doesn't save anything, or appear to be doing anything. It doesn't produce an error message, nor does it save the records. I've tried all combinations of Team, Teams, team an

Re: XML parsing

2009-04-17 Thread smithtrev...@googlemail.com
I had it on debug level 2, so I changed it to level 3 to see if I could find anything out. It produces this, which looks like it should save properly to me. My table has 3 fields, id, name and specialid. [useDbConfig] => default [useTable] => teams [displayFiel

Re: XML parsing

2009-04-17 Thread smithtrev...@googlemail.com
I had it on debug level 2, so I changed it to level 3 to see if I could find anything out. It produces this, which looks like it should save properly to me. My table has 3 fields, id, name and specialid. [useDbConfig] => default [useTable] => teams [displayFiel

SaveAll to save Parsed Array not working.

2009-04-19 Thread smithtrev...@googlemail.com
Hello, I've parsed some XML, and am attempting to save it using the saveAll() method, however it does not save, give me an error message or anything like that. Just nothing happens. I think it thinks it is saving, I've tried test messages to appear if saving occurs, and they always appear. Here i

Re: SaveAll to save Parsed Array not working.

2009-04-22 Thread smithtrev...@googlemail.com
starts with 1 (maybe > not with the newest cake), so maybe yours work too and you just have > to increase the index. > > Hope this helps, > > Michael > > smithtrev...@googlemail.com schrieb: > > > Hello, I've parsed some XML, and am attempting to save it u

Missing Table

2009-04-22 Thread smithtrev...@googlemail.com
I have a table that connects together 3 other tables. It looks like this, teams_managers_seasons team_manager_season_id team_id manager_id season_id When i try the url, /cake/FanteamManagerSeasons .

Re: Missing Table

2009-04-22 Thread smithtrev...@googlemail.com
As sod's law goes, after hours of trying, I finally posted on here... and then I solved it a minute later. Thanks anyway. On Apr 22, 5:04 pm, "smithtrev...@googlemail.com" wrote: > I have a table that connects together 3 other tables. > > It looks like this,

Updating fields based upon a field in another table

2009-04-23 Thread smithtrev...@googlemail.com
Hi, I have a question, if I wanted to update a foreignkey field in a table, based on a date range in another table (eg. it has an id, startdate, enddate). How would I do that? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Updating fields based upon a field in another table

2009-04-23 Thread smithtrev...@googlemail.com
ol' SQL? Also, is it a > one-timer, or is it a part of your site logic? > > smithtrev...@googlemail.com pisze: > > > Hi, > > I have a question, if I wanted to update a foreignkey field in a > > table, based on a date range in another table (eg. it has an id, &

Re: Updating fields based upon a field in another table

2009-04-23 Thread smithtrev...@googlemail.com
>                 $this->Model->OtherModel->getYourKey() >         ); > > } > > echo $form->hidden('the_key', array('value' => $the_key)); > > On Thu, Apr 23, 2009 at 11:50 AM, smithtrev...@googlemail.com > > wrote: > > >