Re: a couple of small things I can't figure out

2008-05-03 Thread damo
just got around the problem by using a hidden field in the form echo $form->hidden('student_id', array('label' => 'Student Number:', 'size'=>5, 'value'=>$student)); works a treat now. But still haven't figured out the flash... --~--~-~--~~~---~--~~ You receive

Re: a couple of small things I can't figure out

2008-05-03 Thread damo
b logica, have taken your advise and renamed the field as you wisely suggested. I'm still perplexed as to why this saves the files, but with nothing in the $student_id: function add($student = null) { if (!empty($this->data) && is_uploaded_file($this->data['Myfile'][

Re: a couple of small things I can't figure out

2008-04-26 Thread b logica
Well, you should change $student to $student_id. Not only will that make it a lot easier to see, at a glance, what's going on 3 months from now when you need to change something, but Cake expects it that way. If you have a model named Student and your MyFile model has a foreign key pointing to Stu

Re: a couple of small things I can't figure out

2008-04-25 Thread damo
Hi Simon, this is what I have put in: view: create('Result');?> Subject Student Number Quiz Result "; echo ""; echo $form->input("Result.{$i}.subject", array('label' => '')); echo ""; echo ""; echo $form->input("Result.{$i}.student", array('label' =>

Re: a couple of small things I can't figure out

2008-04-25 Thread damo
thanks again b logica. Have tried what you have suggested with no luck. What I am passing is just an integer. I am passing this integer to the function so I know which student the file is for. I just had a thought that it might be easier to just pass the variable in the controller rather than

Re: a couple of small things I can't figure out

2008-04-22 Thread b logica
I'm not sure id $student is an integer ID or an entire array. You seem to be treating it as both. You really only need to pass the ID. In your form (the one with the file upload) include something like this: $form->hidden('Student.id', array('value' => $student['Student']['id'])) That variable

Re: a couple of small things I can't figure out

2008-04-21 Thread damo
thanks b logica, it still doesn't seem to work. Let me just clarify what I am trying to do. >From the view of the individual student, which uses the $student variable, I try to add a file. So the $student is passed to the function so that we know which student the file relates to. So in my tabl

Re: a couple of small things I can't figure out

2008-04-21 Thread b logica
> function add($student = null) { > if (!empty($this->data) && > is_uploaded_file($this->data['Myfile']['File'] > ['tmp_name'])) { > $fileData = fread(fopen($this->data['Myfile']['File'] > ['tmp_name'], "r"), > $this->data['Myfile']['File']['

Re: a couple of small things I can't figure out

2008-04-21 Thread [EMAIL PROTECTED]
try http://bin.cakephp.org/ simon On Apr 21, 8:52 am, damo <[EMAIL PROTECTED]> wrote: > mmm, how do I post code to format better in Google Groups?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To

Re: a couple of small things I can't figure out

2008-04-21 Thread damo
mmm, how do I post code to format better in Google Groups?? --~--~-~--~~~---~--~~ 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 grou

Re: a couple of small things I can't figure out

2008-04-21 Thread damo
that's what I figured it would be, but it doesn't seem to work, just takes me to the page without the variable at the end. Here is whole function. I'm also having a problem with one of the lines of code (highlighted below), as it stops it from saving the file all together function add($

Re: a couple of small things I can't figure out

2008-04-21 Thread damo
and one other I've got the upload controller working well, except where I try to do something myself function add($student = null) { if (!empty($this->data) && is_uploaded_file($this->data['Myfile']['File'] ['tmp_name'])) { $fileData = fread(fopen(

Re: a couple of small things I can't figure out

2008-04-20 Thread Federico Rinaldi
This is the right way: $this->flash('The file has been uploaded.', '/students/view/' . $student, 2); On Mon, Apr 21, 2008 at 2:59 AM, damo <[EMAIL PROTECTED]> wrote: > > thanks again for all your help!! > > one more stupid question: > how do I use redirect or flash to go to a URL containing a va

Re: a couple of small things I can't figure out

2008-04-20 Thread damo
thanks again for all your help!! one more stupid question: how do I use redirect or flash to go to a URL containing a variable eg: $this->flash('The file has been uploaded.','/students/view/$student', $pause='2'); can't seem to get the syntax correct... tried about a million different ways, but

Re: a couple of small things I can't figure out

2008-04-19 Thread simonb
OK it is late for me also IStop being such a knob On Apr 19, 10:50 pm, Stephen Orr <[EMAIL PROTECTED]> wrote: > > findAll(array('Table.categoryt' <> "A" ) > > This definitely won't work. > > The array('Table.categoryt' => 'A') part follows PHP syntax, where => > denotes a relationship between th

Re: a couple of small things I can't figure out

2008-04-19 Thread Sliv
findAll(array('NOT' => array('Table.category' => array('A'; http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this

Re: a couple of small things I can't figure out

2008-04-19 Thread Sliv
$this->User->findAll(array('NOT' => array('Table.category' => array('A'; http://cakebaker.42dh.com/2007/04/26/how-to-use-not-in-in-a-condition/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. T

Re: a couple of small things I can't figure out

2008-04-19 Thread Stephen Orr
> findAll(array('Table.categoryt' <> "A" ) This definitely won't work. The array('Table.categoryt' => 'A') part follows PHP syntax, where => denotes a relationship between the key of the array and the value. To have a condition where you want rows that DON'T match, use array('Table.categoryt' =>

Re: a couple of small things I can't figure out

2008-04-19 Thread simonb
findAll(array('Table.categoryt' <> "A" ) Try that. Not so sure about the second problem I use css to set the width regarding multiple records use this input("Product.{$i}.id", array('value' => $node['id'], 'label' => false)); echo $form->input("Product.{$i}.qty"));?> This is place within a fo

Re: a couple of small things I can't figure out

2008-04-19 Thread Femi Taiwo
hi Damo Was stumped about that too a while back... 1I know how to return results that are equal to "A" by => but what about those not equal. ANSWER: findAll(array('Table.categoryt' =>"<>A") Works like a charm! so you could do things likeĀ  ">A" ,">=A" etc... 2..How can I alter

a couple of small things I can't figure out

2008-04-19 Thread damo
I've looked through the manual/book, but mustn't be looking in the right place. 1) How do I: findAll(array('Table.categoryt' != "A" ) ie, I know how to return results that are equal to "A" by => but what about those not equal. Where do I find comparison operators possible for my controller