Re: Array Help

2009-12-25 Thread kangur91
If you want to remove key from array, it's simple unset(example below): foreach($array as $key = $value) { if($value == || $value == || is_null($value)) { unset($array[$key]); You can add if($value != null) use array_reserve function. I wish, I help you. Check out the new CakePHP Questions

RE: Array Help

2009-12-25 Thread Dave
-Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of kangur91 Sent: December-25-09 6:39 PM To: CakePHP Subject: Re: Array Help If you want to remove key from array, it's simple unset(example below): foreach($array as $key = $value) { if($value

Array Help

2009-12-24 Thread Dave
I have this after submitting a form [SelectionsSkills] = Array ( [1] = Array ( [13] = 4 ) [2] = Array ( [1] = 4 ) [3] = Array (

Still sort array help

2009-10-02 Thread Dave Maharaj :: WidePixels.com
No matter what i try I still cant sort an array. $merged = array_merge ($new_skills, $selected); debug($merged); Array ( [0] = Tree [1] = Zoo [2] = Hello [3] = Test [4] = Cool [5] = 3 Doors Down [6] = Yellow ) $sorted = natcasesort($merged);

Re: Still sort array help

2009-10-02 Thread brian
natcasesort() returns a boolean, not an array. debug(natcasesort($merged)); On Fri, Oct 2, 2009 at 6:07 PM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: No matter what i try I still cant sort an array. $merged = array_merge ($new_skills, $selected);    debug($merged); Array

RE: Still sort array help

2009-10-02 Thread Dave Maharaj :: WidePixels.com
Got it! Thanks. Dave -Original Message- From: brian [mailto:bally.z...@gmail.com] Sent: October-02-09 10:27 PM To: cake-php@googlegroups.com Subject: Re: Still sort array help natcasesort() returns a boolean, not an array. debug(natcasesort($merged)); On Fri, Oct 2, 2009 at 6:07

Re: Paginate from an array help - Sorry disregard!

2009-08-14 Thread mike karthauser
: August-13-09 7:50 PM To: cake-php@googlegroups.com Subject: Paginate from an array help I run my find query, get all the data I need but cant figure out how to then pass it off to paginate. $test = $this-Post-__quickQuery($string,$this-Auth-user(rank'), $this-Auth-user('id')); debug

Paginate from an array help

2009-08-13 Thread Dave Maharaj :: WidePixels.com
I run my find query, get all the data I need but cant figure out how to then pass it off to paginate. $test = $this-Post-__quickQuery($string,$this-Auth-user(rank'), $this-Auth-user('id')); debug($test); ...spits out my array of records found but how do i then pass $test to paginate?

RE: Paginate from an array help - Sorry disregard!

2009-08-13 Thread Dave Maharaj :: WidePixels.com
I got it... Sorry. Dave _ From: Dave Maharaj :: WidePixels.com [mailto:d...@widepixels.com] Sent: August-13-09 7:50 PM To: cake-php@googlegroups.com Subject: Paginate from an array help I run my find query, get all the data I need but cant figure out how to then pass it off

Re: Array help

2009-08-11 Thread Martin Westin
*To:* cake-php@googlegroups.com *Subject:* Re: Array help 1. Use a callback function afterFind to loop the return array, remove the empty item. 2. How about give a condition when model-find. [CODE] 'conditions' = array((*not* = array ( Post.id = *null* )), //array of conditions [/CODE

RE: Array help

2009-08-11 Thread Dave Maharaj :: WidePixels.com
Thanks Joshua, That works just as needed. Dave _ From: joshua [mailto:josh...@gmail.com] Sent: August-11-09 1:14 AM To: cake-php@googlegroups.com Subject: Re: Array help I think you can define a model level filter, it will help you to solve this problem thoroughly. Just an idea

Array help

2009-08-10 Thread Dave Maharaj :: WidePixels.com
I have a contain query which produces these results. Basically the user bookmarked a page when they had access. The Owner of the post has changed the level of who can view the Post so in this case this user no longer can view the post hence the missing post data. It was not grabbed because the

Re: Array help

2009-08-10 Thread joshua
1. Use a callback function afterFind to loop the return array, remove the empty item.2. How about give a condition when model-find. [CODE] 'conditions' = array((*not* = array ( Post.id = *null* )), //array of conditions [/CODE] On Tue, Aug 11, 2009 at 10:25 AM, Dave Maharaj :: WidePixels.com

RE: Array help

2009-08-10 Thread Dave Maharaj :: WidePixels.com
-php@googlegroups.com Subject: Re: Array help 1. Use a callback function afterFind to loop the return array, remove the empty item. 2. How about give a condition when model-find. [CODE] 'conditions' = array((not = array ( Post.id = null )), //array of conditions [/CODE] On Tue, Aug 11, 2009 at 10

Re: Array help

2009-08-10 Thread joshua
]); but cant get it to work...still messing around with it -- *From:* joshua [mailto:josh...@gmail.com] *Sent:* August-11-09 12:41 AM *To:* cake-php@googlegroups.com *Subject:* Re: Array help 1. Use a callback function afterFind to loop the return array, remove

Array Help

2009-07-22 Thread Dave Maharaj :: WidePixels.com
I have this array and trying to do a for each Showcase Entry to show up with the Showcase. I just cant seem to get the Entry array for each Showcase to appear. Each Showcase apers but no Entry associated with it. [Showcase] = Array ( [0] = Array (

Re: Array Help

2009-07-22 Thread brian
Run this query on the DB: SELECT * FROM entries WHERE showcase_id = '6bd19a7775f'; See anything? On Wed, Jul 22, 2009 at 12:22 PM, Dave Maharaj :: WidePixels.comd...@widepixels.com wrote: I have this array and trying to do a for each Showcase Entry to show up with the Showcase. I just cant

RE: Array Help

2009-07-22 Thread Dave Maharaj :: WidePixels.com
'] for each of the ['Showcases'] to the view. Dave -Original Message- From: brian [mailto:bally.z...@gmail.com] Sent: July-22-09 2:07 PM To: cake-php@googlegroups.com Subject: Re: Array Help Run this query on the DB: SELECT * FROM entries WHERE showcase_id = '6bd19a7775f'; See anything

Re: Array Help

2009-07-22 Thread Jeff Griffiths
: Re: Array Help Run this query on the DB: SELECT * FROM entries WHERE showcase_id = '6bd19a7775f'; See anything? On Wed, Jul 22, 2009 at 12:22 PM, Dave Maharaj :: WidePixels.comd...@widepixels.com wrote: I have this array and trying to do a for each Showcase Entry to show up

RE: Array Help

2009-07-22 Thread Dave Maharaj :: WidePixels.com
Maharaj :: WidePixels.com [mailto:d...@widepixels.com] Sent: July-22-09 2:20 PM To: cake-php@googlegroups.com Subject: RE: Array Help SELECT * FROM entries WHERE showcase_id = '6bd19a7775f'; Returns nothing because that Showcase has no Entries SELECT * FROM entries WHERE showcase_id = '5edd082b249

RE: Array Help

2009-07-22 Thread Dave Maharaj :: WidePixels.com
Figured it out... Stupid mistake on my part. Thanks guys. Dave -Original Message- From: Jeff Griffiths [mailto:anisotro...@gmail.com] Sent: July-22-09 2:32 PM To: cake-php@googlegroups.com Subject: Re: Array Help I'm not sure I understand. If you have this data structure in your

Re: Array Help

2009-06-22 Thread kdubya
Try something like this (assuming the two arrays you mentioned are called $id and $percent respectively): $combined = array(); foreach ($id as $key=$value) { $combined[$key] = array('id'=$value), 'percent'=$percent[$key]); } --~--~-~--~~~---~--~~ You received

RE: Array Help

2009-06-22 Thread Dave Maharaj :: WidePixels.com
= $this-paginate('Job', array('Job.id' = $combined )); -Original Message- From: kdubya [mailto:kenwin...@winanstech.com] Sent: June-22-09 10:45 AM To: CakePHP Subject: Re: Array Help Try something like this (assuming the two arrays you mentioned are called $id and $percent respectively

Array Help

2009-06-21 Thread Dave Maharaj :: WidePixels.com
How can I edit this array: Array ( [Test] = Array ( [Post] = Array ( [0] = 3 [1] = 4 [2] = 5 [3] = 6 [4] = 7 [5] = 8

Re: Array Help

2009-06-21 Thread mike karthauser
hi dave On 21 Jun 2009, at 13:35, Dave Maharaj :: WidePixels.com wrote: How can I edit this array: Array ( [Test] = Array ( [Post] = Array ( [0] = 3 [1] = 4 [2] = 5 [3] =

RE: Array Help

2009-06-21 Thread Dave Maharaj :: WidePixels.com
From: mike karthauser [mailto:mi...@brightstorm.co.uk] Sent: June-21-09 10:08 AM To: cake-php@googlegroups.com Subject: Re: Array Help hi dave On 21 Jun 2009, at 13:35, Dave Maharaj :: WidePixels.com wrote: How can I edit this array: Array

RE: Array Help

2009-06-21 Thread Dave Maharaj :: WidePixels.com
[percent] = 23 ) ) Thanks, Dave -Original Message- From: mike karthauser [mailto:mi...@brightstorm.co.uk] Sent: June-21-09 10:08 AM To: cake-php@googlegroups.com Subject: Re: Array Help hi dave On 21 Jun 2009, at 13:35, Dave Maharaj

Array Help

2009-03-27 Thread Dave
I am trying to update a Profile by using a slug that was created and saved in the User table. What I need to do is get the Profile.id using the $slug that is in User.slug In the controller: This is in the profiles_controller var $uses = array('Profile', 'User'); function