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
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'][
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
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' =>
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
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
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
> 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']['
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
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
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($
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(
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
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
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
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
$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
> 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' =>
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
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
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
21 matches
Mail list logo