Validating based on different fields

2009-03-25 Thread gkc
I am trying to find a way to validate certain fields based on whether not another field is filled/ selected. I have a drop down that depending on which item is selected will expose other form fields. I need to validate the fields that are exposed for the selected item, and not the others. Does

Re: Help with a query

2009-03-16 Thread gkc
Miles, thank you for your response. I am not using a model or a find on this. I havent had the time to really learn the whole relational model concept and I am in a hurry to get this so I am just using Model-query for this one. I am sure it would be a lot easier, but maybe for another project.

Help with a query

2009-03-15 Thread gkc
I need help getting back the right results from a query. I have an article table (articles), an authors table (authors), and a join table to reference the two (articles_authors) . The articles have multiple authors. I am trying to do a search of author first/ last name and return the list of

Re: Query using LEFT()

2009-02-05 Thread gkc
')) In my view I have this $post['Post']['body'] but I keep getting the error Undefined index: body Any help would be greatly appreciated. On Feb 5, 9:20 am, Alfredo Quiroga-Villamil laww...@gmail.com wrote: gkc: If I understood your question correctly what you want is something like

Re: Query using LEFT()

2009-02-05 Thread gkc
Undefined index: body when using $post['Post']['body']. Thanks for the help! On Feb 5, 11:54 am, Siegfried Hirsch siegfried.hir...@gmail.com wrote: Hello gkc, I have just tried the following in my app: $vendors = $this-find('all',                                array('conditions'=array

Re: Query using LEFT()

2009-02-05 Thread gkc
( [username] = ) ) ) Why would it come up as 0 and not under Post? gkc On Feb 5, 12:31 pm, AD7six andydawso...@gmail.com wrote: On Feb 5, 7:24 pm, gkc gerardkco...@gmail.com wrote: Siegfried: I was using 1.2.0.7962 but I just downloaded

Query using LEFT()

2009-02-04 Thread gkc
I need to limit the amount of characters returned on a field. I have tried using 'fields'=array('LEFT(field,200) AS \'field\'') but I get an undefined index: field error when I do this. Any suggestions would be greatly appreciated. --~--~-~--~~~---~--~~ You

Re: Query using LEFT()

2009-02-04 Thread gkc
]][$field [title]]) 25?substr($data['records'][$i][$field[table]][$field [title]],0,22):$data['records'][$i][$field[table]][$field [title]] ).nbsp;/td; On Feb 4, 12:28 pm, gkc gerardkco...@gmail.com wrote: I need to limit the amount of characters returned on a field. I have tried using

Re: Query using LEFT()

2009-02-04 Thread gkc
Can anybody help with this? On Feb 4, 1:27 pm, gkc gerardkco...@gmail.com wrote: This is according to the documentation: = If you need to use SQL operators such as in (MySQL) DISTINCT, MAX, MIN, etc... you can specify it as part of the 'fields' key

Re: Cannot modify header information - headers already sent by

2009-02-03 Thread gkc
= Any ideas? On Feb 3, 7:54 am, AD7six andydawso...@gmail.com wrote: On Feb 3, 7:45 am, gkc gerardkco...@gmail.com wrote: I have researched this problem and have already removed any blank space after the closing php tag. Here

Re: Cannot modify header information - headers already sent by

2009-02-03 Thread gkc
, AD7six andydawso...@gmail.com wrote: On Feb 3, 5:46 pm, gkc gerardkco...@gmail.com wrote: Ok, I removed the php close tag from all the models and controllers but that didnt work. Here is the full error message I am getting: = Warning

Re: Select MAX(date)

2009-02-03 Thread gkc
what you're looking for. If not explain a bit more and I'll see if I can help. On Feb 3, 3:53 pm, gkc gerardkco...@gmail.com wrote: How would I structure a query to return the newest entry based on a date? If I was writing out the query I would just use MAX(date) but Im not sure how

Select MAX(date)

2009-02-03 Thread gkc
How would I structure a query to return the newest entry based on a date? If I was writing out the query I would just use MAX(date) but Im not sure how would format the $this-Model-find(). Any help would be greatly appreciated. gkc --~--~-~--~~~---~--~~ You

Cannot modify header information - headers already sent by

2009-02-02 Thread gkc
I have researched this problem and have already removed any blank space after the closing php tag. Here is the controller code: function beforeFilter() { if(isset($this-params['admin'])) { $this-checkAdminSession(); $allowed =

Re: how to show table and fetch mysql queries in the coloumns of table

2009-02-02 Thread gkc
The query code should go in the controller. It might look something like this: $this-set('stats',$this-Model-find('all',array('fields'=array ('field1','field2'; In your view code you would do something like this: ?php foreach($stats as $stat): ? table tr td?php

Removing Admin from non-admin pages

2009-01-22 Thread gkc
I am currently using the default admin routing for the few pages that have admin functions. However, for pages that dont have admin functions, the links still display admin in front and thus I get function/ view errors. How can I remove the admin part from the link that does not have any admin

Sessions not writing whole string

2009-01-22 Thread gkc
As part of my login query, I am writing the user role to the the session with $this-Session-write('User.role',$this-$dbuser['User'] ['role']). However, when I call the $this-Session-read('User.role'), it is only returning the first character of the role. If I place the whole result in the

Missing View

2009-01-20 Thread gkc
I started off withe the default pages controller and route and used it to create another controller/ route. Everything is working just fine. I then did it again to make a third controller/ route but this time I am getting 'Missing View' errors. All the controllers code and routes are the same,

Re: Missing View

2009-01-20 Thread gkc
')); As I noted in my previous post, the first route I created works just fine. Its the second one that I am having problems with. gkc On Jan 20, 2:52 pm, brian bally.z...@gmail.com wrote: Just

Re: Missing View

2009-01-20 Thread gkc
I fixed it. I just changed the names of the controllers. On Jan 20, 3:10 pm, gkc gerardkco...@gmail.com wrote: Sorry, I didnt think I would need to since I just copied everything exactly like the pages controller/ route. Here are the routes