×
Kunena 5.2.9 released and Kunena 6.0.0 (08 Jun 2022)

The Kunena team has announce the arrival of Kunena 5.2.9 [K 5.2.9] which is now available for download as a native Joomla extension for J! 3.10. This version addresses most of the issues that were discovered in K 5.2 and issues discovered during the development stages of previous version of K5.2.

The Kunena team has announce the arrival of Kunena 6.0.0 [K 6.0.0] which is now available for download as a native Joomla extension for J! 4.1.x. Only the module kunena latest and the discuss plugin which are still in beta are working in Joomla! 4.1 with Kunena 6.0.

× This is for users to help other users, to discuss topics that are related to forum administration in general or problems in running Joomla. This is not the place to ask for Joomla support. If you want assistance with Joomla please ask at forum.joomla.org

Question MySQL Database Code load query question

  • C0n
  • C0n's Avatar Topic Author
  • Offline
  • Premium Member
  • Only the strongest will survive
More
10 years 5 months ago - 10 years 5 months ago #1 by C0n
So i see this allot through the joomla framework and i am curious to what the diffrence between running the code that contains
(int)$database->loadResult();

And
$database->loadResult();

No matter what one you use they both have the same output but i just can not find or figure out what the purpose of the "(int)" is ?

When i look around i find on PHP.net it is a integer of some kind for defining variables and functions. (php.net/manual/en/language.types.integer.php)
Last edit: 10 years 5 months ago by C0n.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #2 by xillibit
Hello,

by adding (int) your are that the variable $database->loadResult(); in an integer

I don't provide support by PM, because this can be useful for someone else.

Please Log in or Create an account to join the conversation.

  • C0n
  • C0n's Avatar Topic Author
  • Offline
  • Premium Member
  • Only the strongest will survive
More
10 years 5 months ago - 10 years 5 months ago #3 by C0n
So does it increase or decrease the queries performance ? Also i thought there should be a value for integers. not just (int) or it tells it to use a default value ?
Last edit: 10 years 5 months ago by C0n.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #4 by Matias
It has no effect on performance, but simplifies code in the case if the query doesn't find an item. In that case it returns 0 and not NULL, which may need further check.

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.063 seconds