Using String when Creating a Form

  • George L.
  • Bronze Member
  • Bronze Member
  • No Avatar
  • Joined: Nov 05, 2007
  • Posts: 2206
  • Loc: Malaysia
  • Status: Offline

Post January 17th, 2011, 7:39 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post January 17th, 2011, 7:39 am

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 6128
  • Loc: Seattle, WA
  • Status: Offline

Post January 17th, 2011, 1:42 pm

What is the SQL type of 'value'?
The Beer Monocle. Classy.
  • George L.
  • Bronze Member
  • Bronze Member
  • No Avatar
  • Joined: Nov 05, 2007
  • Posts: 2206
  • Loc: Malaysia
  • Status: Offline

Post January 17th, 2011, 8:45 pm

It's float (8,4).

Is that what you mean by SQL type, spork ?

Thanks.

:-)
  • George L.
  • Bronze Member
  • Bronze Member
  • No Avatar
  • Joined: Nov 05, 2007
  • Posts: 2206
  • Loc: Malaysia
  • Status: Offline

Post January 18th, 2011, 7:50 am

SOLVED.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: Zealous and 123 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.