Announcement

  •  » Requests
  •  » BUG: If you don't use a table prefix, db keywords used for table names

#1 2021-11-07 01:06:40

MikeTheKID
Member
2016-12-30
27

BUG: If you don't use a table prefix, db keywords used for table names

If you don't have a prefix in your table names, there will be a table created called: "groups" which is a SQL keyword and MySQL struggles with the dynamic queries built by PHP. How I got around this is in the PHP code I safely escape all mentions to a table name using back-ticks. I believe this could be an easy patch fix, to add back ticks to escape table names when queries are being constructed.

Sudo code:

<?

$query = 'SELECT * FROM `'.$table.'` ORDER BY 1;';

?>


Otherwise can someone prescribe what needs to be done so if I go and update all my table tables, that my website will know that I added a prefix, post-install?

Offline

 

#2 2021-11-07 02:01:02

erAck
Only trying to help
2015-09-06
2026

Re: BUG: If you don't use a table prefix, db keywords used for table names

In the database change all your tables to have a prefix, like piwigo_... or pwg_... and change/add that in local/config/database.inc.php

$prefixeTable = 'piwigo_';


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2021-11-07 04:14:12

windracer
Member
St. Pete, FL
2014-12-28
455

Re: BUG: If you don't use a table prefix, db keywords used for table names

Offline

 

#4 2021-11-07 11:46:54

erAck
Only trying to help
2015-09-06
2026

Re: BUG: If you don't use a table prefix, db keywords used for table names

[Github] Piwigo issue #1547 apparently fixed for 12.1.0


Running Piwigo at https://erack.net/gallery/

Offline

 
  •  » Requests
  •  » BUG: If you don't use a table prefix, db keywords used for table names

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact