0

I have tried using this to access the database:

return $db->execute('SELECT `id` FROM `main_games` WHERE `id`=?', array($this->getSubdomain));

I am not sure if that worked, as it doesn't even comes up with anything. I have checked that the data should exist but my function always comes up false. Do I have to do another command to return the number of rows?

tadman
  • 208,517
  • 23
  • 234
  • 262
Marko Livendo
  • 97
  • 3
  • 9

1 Answers1

2

I don't know exactly what you are trying to do. But to get the number of rows in a table, say my_table, you can do this in SQL:

SELECT COUNT(*) FROM my_table
Omid Kamangar
  • 5,768
  • 9
  • 40
  • 69