⇧
vadnica-logo
My Services About the Project Telegram O meni O meni

Executing Statements with the query() Method

The query() method executes an SQL statement in a single step and returns the result set as a PDOStatement object. Unlike the prepare() method, queries here are not pre-compiled, making it ideal for simple SELECT commands that contain no user-supplied data (e.g., listing categories or system settings). It is faster and requires shorter syntax since it bypasses a separate call to the execute() method.

EXAMPLE
RESULT
The result will be displayed here...

Practical Application: Use the query method only when the SQL statement is predetermined and safe from outside manipulation. Check the process at home by following these steps: