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
  • 200,744
  • 21
  • 223
  • 248
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,718
  • 9
  • 38
  • 68