We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Changing paths in database

Development and Programming

labtjd's avatar
labtjd
11 posts
4 years ago
labtjd's avatar labtjd

Upload paths for images, etc seem to be in the database. So, in moving to a new server it seems not to update those paths, and if I go to the image upload editor to change them, I get:

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘0’ in ‘where clause’: SELECT group_id, group_name, sort_order FROM (exp_category_groups) WHERE site_id = 1 AND (exclude_group = “0” OR exclude_group = “1”) ORDER BY group_name ee/legacy/database/drivers/mysqli/mysqli_connection.php:117

Stack Trace: Please include when reporting this error

0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query(‘SELECT `group_i…’)

1 ee/legacy/database/DB_driver.php(270): CI_DB_mysqli_driver->_execute(‘SELECT `group_i…’)

2 ee/legacy/database/DB_driver.php(180): CI_DB_driver->simple_query(‘SELECT `group_i…’)

3 ee/legacy/database/DB_active_rec.php(1138): CI_DB_driver->query(‘SELECT `group_i…’)

4 ee/legacy/models/category_model.php(100): CI_DB_active_record->get()

5 ee/EllisLab/ExpressionEngine/Controller/Files/Uploads.php(312): Category_model->get_category_groups(”, false, 1)

6 ee/EllisLab/ExpressionEngine/Controller/Files/Uploads.php(49): EllisLab\ExpressionEngine\Controller\Files\Uploads->form()

7 [internal function]: EllisLab\ExpressionEngine\Controller\Files\Uploads->create()

8 ee/EllisLab/ExpressionEngine/Core/Core.php(241): call_user_func_array(Array, Array)

9 ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)

10 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))

11 index.php(148): require_once(‘…’)

11 index.php(148): require_once(‘…’)

I am on 5.3.2 PHP 7.2.24 Centos 8

       
Brian Litzinger's avatar
Brian Litzinger
704 posts
4 years ago
Brian Litzinger's avatar Brian Litzinger

You can skip the database all together when defining upload paths: https://docs.expressionengine.com/latest/general/system-configuration-overrides.html#upload_preferences

Define them in your config, then you don’t need to worry about editing them in the control panel.

       
labtjd's avatar
labtjd
11 posts
4 years ago
labtjd's avatar labtjd

Thanks, do you think that setting the proper path would also clear that php error?

       
labtjd's avatar
labtjd
11 posts
4 years ago
labtjd's avatar labtjd

Okay, yes, it is possible to override in the configuration files, but my fundamental issue was incorrect sql being submitted. I noticed that the query would run if I just had single quotes on the ‘0’. So, there is a mysql setting that allows double quotes to act as single quotes. Which is something about ansi_quotes sql mode.

So change the mode on your mysql server

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.