skip to Main Content

Php – Why I'm getting error when using LIMIT with PDO

here my code : $Limit=5; $sql = 'SELECT * FROM [dbo].[table_name] ORDER BY [count] DESC LIMIT :limit'; $stmt = $db->prepare($sql); $stmt->bindValue(':limit', (int) $Limit, PDO::PARAM_INT); $results = $stmt->execute(); and here the error im getting : Fatal error: Uncaught PDOException: SQLSTATE[HY090]: Invalid…

VIEW QUESTION

error while running my php laravel program

IlluminateDatabaseQueryException could not find driver (Connection: mysql, SQL: select * from `site_settings` order by `created_at` desc limit 1) at vendorlaravelframeworksrcIlluminateDatabaseConnection.php:829 825▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 826▕ ); 827▕ } 828▕ ➜ 829▕ throw new QueryException( 830▕ $this->getName(), $query, $this->prepareBindings($bindings), $e…

VIEW QUESTION
Back To Top
Search