MySQL Query - number of rows

Hello,
Stupid question, but how can I find out how many rows my SQL query
returned?

@grab_new_entries = NewEntries.connection.select_all(“SELECT displayname
AS displayname FROM new_entries”)

@grab_new_entries.num_rows didn’t work…

Thanks,

  • Jeff M.

On 19 Apr 2008, at 00:08, Jeff M. wrote:

Hello,
Stupid question, but how can I find out how many rows my SQL query
returned?

@grab_new_entries = NewEntries.connection.select_all(“SELECT
displayname
AS displayname FROM new_entries”)

It’s just an array. @grab_new_entries.length

Fred

oh, I didn’t know that. Thanks!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs