# Post.where() causing 500 error

**URL:** <https://meta.discourse.org/t/post-where-causing-500-error/40896>\
**Category:** Development\
**Created:** [March 11, 2016, 10:33am UTC](https://meta.discourse.org/t/post-where-causing-500-error/40896 "2016-03-11T10:33:23Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Byrne](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_byrne/32/116413_2.png) [@Andrew\_Byrne](https://meta.discourse.org/u/Andrew_Byrne)\
**Post date:** [March 11, 2016, 10:33am UTC](https://meta.discourse.org/t/post-where-causing-500-error/40896/1 "2016-03-11T10:33:23Z")

</div>

Noooob question (2 days ruby experience 😉  
I have a plugin almost doing what I want but have a hang up here:

```
 posts = Post.where('user_id = ? and post_number = ?', params["uid"], params["tid"])
		      .order(created_at: :desc)
		      .limit(params["total"])

```

I’ve tried a number of versions. but they all case errors .  
It feels more like a query issues than syntax but I bow before the experts edu-mecate me.

---

_[View the full topic](https://meta.discourse.org/t/post-where-causing-500-error/40896)._
