Ok so whats the URL that saveRating() points to? And what does the
action look like.

On Oct 12, 2:40 pm, Tomfox Wiranata <tomfox.wiran...@gmail.com> wrote:
> hi,
>
> when a user clicks on a product link a url like this opens:   products/
> show/45
>
> 45 is the products id. this id is part of a select statement to
> retrieve the correct information from the database.
> controller function:
>
> show($id=null){
> some code...
>           SELECT * from products WHERE products.id=$id...;
> some code...
>
> }
>
> now the user has the opportunity to rate this product. after the user
> rated i wanna show the new result and the new count. of course with
> ajax feeling. so I use JQUERY to pass the rating value to a function
> named "rate".
>
>         $("#lkbl_rating_stars_list").stars({
>                 inputType: "select",
>                 cancelShow: false,
>                 callback:  function(value, link){
>                 saveRating();
>         }
>         });
>
> function saveRating()
> {
>                                 var ui = 
> $("#lkbl_rating_stars_list").data("stars");
>                                 var ratingValue = ui.options.value;
>                                 $('#ratingt').load('rate', {data: 
> ratingValue});
>
> }
>
> now cake throws error
> "Warning 512: SQL error. cant find column rate". looking at the sql
> statement that is generated:
>
> SELECT * from products WHERE products.id=rate...;
>
> that tells me, that jquery send the data thru the URL and somehow the
> $id is replaced by "rate"...which makes no sense :)
>
> HOW do I have to pass data with jquery to my controller without
> screwing with the url? is .load not correct?
>
> appreciate it. thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to