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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en