If you look at documentation will see that the return of the method exec
is of the boolean type, ie it will return 0 (false
) whether the operation failed or 1 (true
) if the operation was successful. Therefore you always receive 1, the operation is always occurring smoothly.
The exec
is to run no darlings, that is, to execute commands that do not give results except by the information if it occurred without problems. Typical cases are the CREATE
, The INSERT
, etc..
When you are searching for information in the database, that is, you are using SELECT
need to use methods that bring these results to a variable or can be read with other class methods.
To get the result you want you will probably need the method QuerySingle()
or possibly the Query. This may not be the case now, but the Prepare()
may also be useful in other situations.
There are still other ways to access this, so it’s good to take a look at class documentation as a whole, you can learn a lot of cool stuff there, especially with the examples.
Other reference of the same manual with more complete information and other ways to recover the required data using a slightly different class than the one you are using. Take a good look, it may be more advantageous to exchange your code to use this class.
That’s right, thank you
– akm