René's URL Explorer Experiment


Title: Joomla 5: MySQL Error -- 2014 - Commands out of sync; you can't run this command now · Issue #296 · joomla-framework/database · GitHub

Open Graph Title: Joomla 5: MySQL Error -- 2014 - Commands out of sync; you can't run this command now · Issue #296 · joomla-framework/database

X Title: Joomla 5: MySQL Error -- 2014 - Commands out of sync; you can't run this command now · Issue #296 · joomla-framework/database

Description: I am working to upgrade a module from Joomla 3 to Joomla 5. I'm using Joomla 5.0.2, PHP 8.2 and the module I'm upgrading has multiple dropdowns. I'm running into an error that I have not seen before and I'm stuck. This is the error: 2014...

Open Graph Description: I am working to upgrade a module from Joomla 3 to Joomla 5. I'm using Joomla 5.0.2, PHP 8.2 and the module I'm upgrading has multiple dropdowns. I'm running into an error that I have not seen befor...

X Description: I am working to upgrade a module from Joomla 3 to Joomla 5. I'm using Joomla 5.0.2, PHP 8.2 and the module I'm upgrading has multiple dropdowns. I'm running into an error that I have no...

Opengraph URL: https://github.com/joomla-framework/database/issues/296

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Joomla 5:    MySQL Error -- 2014 - Commands out of sync; you can't run this command now","articleBody":"I am working to upgrade a module from Joomla 3 to Joomla 5. I'm using Joomla 5.0.2, PHP 8.2 and the module I'm upgrading has multiple dropdowns. I'm running into an error that I have not seen before and I'm stuck. This is the error:\r\n\r\n2014 - Commands out of sync; you can't run this command now\r\n\r\nI've built modules like this in Joomla 3 many times. The process is I'm calling a Stored Procedure to get the dataset I need to create the dropdown object, I return the created object and I move to the next dropdown. The functions are called sequentially from the main php file in the module to the helper.php file.\r\n\r\nWhen I run the code this the first dropdown object is returned correctly. However, when the code reaches the setQuery line in the dropdown_2 function in the helper.php file I get the \"out of sync\" error listed above.\r\n\r\nI thought the issue was with the dropdwon_2 function, but when I comment out the call to dropdown_1 function I receive back the dropdown_2 object and the error occurs in the dropdown_3 function, same place in the setQuery line. Any combination of running the different functions seems to produce the same result.\r\n\r\n### Steps to reproduce the issue\r\n\r\nHere's an example of the code in my helper.php file.\r\n\r\npublic static function GetDropdown1($name, $details) \r\n{\r\n\t\t$db = Factory::getContainer()-\u003eget('DatabaseDriver');\t\r\n\t\t$db-\u003esetQuery(\"call StoredProcedure_1\");\r\n\t\t$results1 = $db-\u003eloadObjectList();\r\n\t\t\r\n\t\t...foreach to create the $dropdown_1 object\r\n\t\t\r\n\t\treturn $dropdown_1;\r\n}\r\n\r\npublic static function GetDropdown2($name, $details) \r\n{\r\n\t\t$db = Factory::getContainer()-\u003eget('DatabaseDriver');\t\r\n\t\t$db-\u003esetQuery(\"call StoredProcedure_2\");    //   \u003c--- error occurs here\r\n\t\t$results2 = $db-\u003eloadObjectList();\r\n\t\t\r\n\t\t...foreach to create the $dropdown_2 object\r\n\t\t\r\n\t\treturn $dropdown_2;\r\n}\r\n\r\npublic static function GetDropdown3($name, $details) \r\n{\r\n\t\t$db = Factory::getContainer()-\u003eget('DatabaseDriver');\t\t\r\n\t\t$db-\u003esetQuery(\"call StoredProcedure_3\");\r\n\t\t$results3 = $db-\u003eloadObjectList();\r\n\t\t\t\t\r\n\t\t...foreach to create the dropdown_3 object\r\n\t\t\r\n\t\treturn $dropdown_3;\r\n\t\r\n}\r\n\r\npublic static function GetDropdown4($name, $details) \r\n{\r\n\t\t$db = Factory::getContainer()-\u003eget('DatabaseDriver');\t\t\r\n\t\t$db-\u003esetQuery(\"call StoredProcedure_3\");\r\n\t\t$results4 = $db-\u003eloadObjectList();\r\n\t\t\t\t\r\n\t\t...foreach to create the dropdown_4 object\r\n\t\t\r\n\t\treturn $dropdown_4;\t\r\n}\r\n\r\n\r\n### Expected result\r\n\r\nIn Joomla 3 this code would output the 4 dropdown objects I need for the module.  In Joomla 5 (and I assume Joomla 4) it is not possible to run back-to-back-to-back functions like this calling a stored procedure.\r\n\r\n### Actual result\r\n\r\nActual result is I receive this error:\r\n\r\n2014 - Commands out of sync; you can't run this command now\r\n\r\n### System information (as much as possible)\r\n\r\nJoomla version:   5.0.2\r\nPHP version:        8.2.9\r\nMySQL version:   8.0.28\r\nDB Type:              MySQLi\r\nServer:                 AWS Linux 2023\r\n\r\n### Additional comments\r\n\r\n**Important:**  Changing the DB type in Joomla to MySQL (PDO) solves the problem.  When I run the page containing the module after changing the DB type to MySQL (PDO) it runs as expected with no errors.  However, I would prefer to use MySQLi if possible.\r\n\r\nResearching the issue, it appears to be related to prepared statements in PHP.  My understanding is that MySQL (PDO) does not use prepared statements and probably that is why it works correctly.  \r\n\r\nLet me know what else you need to review this case.  Thanks.","author":{"url":"https://github.com/mbond87","@type":"Person","name":"mbond87"},"datePublished":"2024-01-24T19:49:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/296/database/issues/296"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ed3e8db2-e288-d642-6d71-25defca96627
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8028:23DC68:C38044:FD148B:69928F64
html-safe-nonce5fa07b7a485b38a77de832380013c9b255f90fa0dfbd520df2bc2843f80337ab
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDI4OjIzREM2ODpDMzgwNDQ6RkQxNDhCOjY5OTI4RjY0IiwidmlzaXRvcl9pZCI6IjU3OTA2MjY4MDE3NTY4MzU2ODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9fc9075f67d03a67dc1ce141ab1f5ea1cbad70a18b5ac3bec386bfa420b86c60
hovercard-subject-tagissue:2098970931
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/joomla-framework/database/296/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ce827cdd7df81f4ba8318e683d800ef2a91e32f6d492aece6f47b938254139d8/joomla-framework/database/issues/296
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ce827cdd7df81f4ba8318e683d800ef2a91e32f6d492aece6f47b938254139d8/joomla-framework/database/issues/296
og:image:altI am working to upgrade a module from Joomla 3 to Joomla 5. I'm using Joomla 5.0.2, PHP 8.2 and the module I'm upgrading has multiple dropdowns. I'm running into an error that I have not seen befor...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamembond87
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
go-importgithub.com/joomla-framework/database git https://github.com/joomla-framework/database.git
octolytics-dimension-user_id6124926
octolytics-dimension-user_loginjoomla-framework
octolytics-dimension-repository_id8385748
octolytics-dimension-repository_nwojoomla-framework/database
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id8385748
octolytics-dimension-repository_network_root_nwojoomla-framework/database
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release848bc6032dcc93a9a7301dcc3f379a72ba13b96e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/joomla-framework/database/issues/296#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjoomla-framework%2Fdatabase%2Fissues%2F296
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fjoomla-framework%2Fdatabase%2Fissues%2F296
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=joomla-framework%2Fdatabase
Reloadhttps://patch-diff.githubusercontent.com/joomla-framework/database/issues/296
Reloadhttps://patch-diff.githubusercontent.com/joomla-framework/database/issues/296
Reloadhttps://patch-diff.githubusercontent.com/joomla-framework/database/issues/296
joomla-framework https://patch-diff.githubusercontent.com/joomla-framework
databasehttps://patch-diff.githubusercontent.com/joomla-framework/database
Please reload this pagehttps://patch-diff.githubusercontent.com/joomla-framework/database/issues/296
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fjoomla-framework%2Fdatabase
Fork 37 https://patch-diff.githubusercontent.com/login?return_to=%2Fjoomla-framework%2Fdatabase
Star 30 https://patch-diff.githubusercontent.com/login?return_to=%2Fjoomla-framework%2Fdatabase
Code https://patch-diff.githubusercontent.com/joomla-framework/database
Issues 18 https://patch-diff.githubusercontent.com/joomla-framework/database/issues
Pull requests 7 https://patch-diff.githubusercontent.com/joomla-framework/database/pulls
Discussions https://patch-diff.githubusercontent.com/joomla-framework/database/discussions
Actions https://patch-diff.githubusercontent.com/joomla-framework/database/actions
Projects 0 https://patch-diff.githubusercontent.com/joomla-framework/database/projects
Wiki https://patch-diff.githubusercontent.com/joomla-framework/database/wiki
Security 0 https://patch-diff.githubusercontent.com/joomla-framework/database/security
Insights https://patch-diff.githubusercontent.com/joomla-framework/database/pulse
Code https://patch-diff.githubusercontent.com/joomla-framework/database
Issues https://patch-diff.githubusercontent.com/joomla-framework/database/issues
Pull requests https://patch-diff.githubusercontent.com/joomla-framework/database/pulls
Discussions https://patch-diff.githubusercontent.com/joomla-framework/database/discussions
Actions https://patch-diff.githubusercontent.com/joomla-framework/database/actions
Projects https://patch-diff.githubusercontent.com/joomla-framework/database/projects
Wiki https://patch-diff.githubusercontent.com/joomla-framework/database/wiki
Security https://patch-diff.githubusercontent.com/joomla-framework/database/security
Insights https://patch-diff.githubusercontent.com/joomla-framework/database/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/joomla-framework/database/issues/296
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/joomla-framework/database/issues/296
Joomla 5: MySQL Error -- 2014 - Commands out of sync; you can't run this command nowhttps://patch-diff.githubusercontent.com/joomla-framework/database/issues/296#top
https://github.com/mbond87
https://github.com/mbond87
mbond87https://github.com/mbond87
on Jan 24, 2024https://github.com/joomla-framework/database/issues/296#issue-2098970931
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.