Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDatabaseMySQLi::query: 1064 error after update from 1.7 #195

Closed
csbalazs opened this issue Apr 19, 2012 · 2 comments
Closed

JDatabaseMySQLi::query: 1064 error after update from 1.7 #195

csbalazs opened this issue Apr 19, 2012 · 2 comments

Comments

@csbalazs
Copy link

One of my own component (business directory) ran perfectly on 1.7 and
after updating to 2.5 it throws the following error referring to an SQL
query:

JDatabaseMySQLi::query: 1064 - You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near '' at line 1 SQL=SELECT jos_bd_packages.picture_num
FROM jos_bd_businesses LEFT JOIN jos_bd_packages ON
jos_bd_packages.id=jos_bd_businesses.package_id WHERE jos_bd_businesses.id=

Call stack

Function Location

1 JAdministrator->dispatch() /var/www/virtual/domain.com/htdocs/administrator/index.php:46
2 JComponentHelper::renderComponent() /var/www/virtual/domain.com/htdocs/administrator/includes/application.php:152
3 JComponentHelper::executeComponent() /var/www/virtual/domain.com/htdocs/libraries/joomla/application/component/helper.php:357
4 require_once() /var/www/virtual/domain.com/htdocs/libraries/joomla/application/component/helper.php:388
5 JController->execute() /var/www/virtual/domain.com/htdocs/administrator/components/com_businessdirectory/businessdirectory.php:12
6 BusinessDirectoryController->display() /var/www/virtual/domain.com/htdocs/libraries/joomla/application/component/controller.php:754
7 JController->display() /var/www/virtual/domain.com/htdocs/administrator/components/com_businessdirectory/controller.php:11
8 BusinessDirectoryViewBusiness->display() /var/www/virtual/domain.com/htdocs/libraries/joomla/application/component/controller.php:715
9 JView->get() /var/www/virtual/domain.com/htdocs/administrator/components/com_businessdirectory/views/business/view.html.php:10
10 BusinessDirectoryModelBusiness->getForm() /var/www/virtual/domain.com/htdocs/libraries/joomla/application/component/view.php:482
11 JDatabase->loadResult() /var/www/virtual/domain.com/htdocs/administrator/components/com_businessdirectory/models/business.php:37
12 JDatabaseMySQLi->query() /var/www/virtual/domain.com/htdocs/libraries/joomla/database/database.php:1109
13 JError::raiseError() /var/www/virtual/domain.com/htdocs/libraries/joomla/database/database/mysqli.php:396
14 JError::raise() /var/www/virtual/domain.com/htdocs/libraries/joomla/error/error.php:251

The interesting thing is, that every other query works fine under Joomla
2.5.

Is there some kind of change in query syntax between 1.7 and 2.5?
I'm looking for a solution for the problem.

Joomlacode:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=28435

@csbalazs
Copy link
Author

query in business.php:

$db->setQuery("SELECT #__bd_packages.picture_num FROM #__bd_businesses
LEFT JOIN #__bd_packages ON #__bd_packages.id=#__bd_businesses.package_id WHERE
#__bd_businesses.id=".JRequest::getVar('id'));

@csbalazs
Copy link
Author

I have found the source of the problem.
It was in a custom list field with the following line:
$query = new JDatabaseQuery;
The "new JDatabaseQuery" is probably not supported any more in 2.5,
so it only works with the following:
$query = $db->getQuery(true); - where $db id the database object.

wilsonge pushed a commit to wilsonge/joomla-cms that referenced this issue May 26, 2019
repair privacycheck request and refactor js
hans2103 pushed a commit to hans2103/joomla-cms that referenced this issue Nov 18, 2020
…a#195)

* No separate dropdown toggle for menu items without a link

* Remove unnecessary css change

* SCSS fixes, thanks @drmenzelit

Co-authored-by: @drmenzelit

* Fix a11y

* Fix empty titles for heading and separator menu items

* Css improvements

Add underline for button
Add margin to toggler
Add style for focus state

* Correct height of li elements in submenu

* Add underline for button on submenu (menu position)

* Don't show submenu items if they shall be hidden

* Fix underline for active menu item in sidebar

* Fix parent menu item without link in mobile view

* Fix underline on sidebar, fix height of elements

* Avoid overflow in cards

Co-authored-by: Viviana Menzel <vivianamenzel@dr-menzel-it.de>
Co-authored-by: chmst <dev@chmst.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants