Using String when Creating a Form

  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

Code: [ Select ]
<?php
echo $this->Rating->display(array(
  'item' => $food['Food']['id'],
  'type' => 'radio',
  'stars' => 5,
  'value' => $food['Food']['rating'],
  'createForm' => array('url' => array($this->passedArgs, 'rate' => $food['Food']['id'], 'redirect' => true))));
?>
  1. <?php
  2. echo $this->Rating->display(array(
  3.   'item' => $food['Food']['id'],
  4.   'type' => 'radio',
  5.   'stars' => 5,
  6.   'value' => $food['Food']['rating'],
  7.   'createForm' => array('url' => array($this->passedArgs, 'rate' => $food['Food']['id'], 'redirect' => true))));
  8. ?>


Hi, I need to get the value of table "food" into this array as string. The error is I'm treating array variable in the context of string and it returned me an error.

What's the substitute of this so the value rating is in string data type ? thanks.

Code: [ Select ]
'value' => $food['Food']['rating']
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

What is the SQL type of 'value'?
  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

It's float (8,4).

Is that what you mean by SQL type, spork ?

Thanks.

:-)
  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

SOLVED.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 67 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.