4images Help / Hilfe > Bug Fixes & Patches
PHP 8 - Fix for Image Gallery 1.8 - Ready to use / Fertig zum Anwenden
wflorian:
Danke!
kitty999:
Hi,
Thanks for taking the time to share this!
It seems to work for the most part except i keep getting warnings:
Warning: Undefined array key "user_level"
Warning: Undefined array key "user_name"
etc.
Any thoughts on how to fix this?
Thanks
kp:
--- Quote from: kitty999 on September 10, 2023, 10:44:11 PM ---Hi,
Thanks for taking the time to share this!
It seems to work for the most part except i keep getting warnings:
Warning: Undefined array key "user_level"
Warning: Undefined array key "user_name"
etc.
Any thoughts on how to fix this?
Thanks
--- End quote ---
On which pages to get this warnings? (see URL in browser).
kitty999:
It was several pages, but I seem to have fixed it by declaring the varibales blank if not used, for example:
$user_info['user_level'] = isset($user_info['user_level']) ? $user_info['user_level'] : '';
$user_info['user_name'] = isset($user_info['user_name']) ? $user_info['user_name'] : '';
etc.
Everything seems to work fine except I'm not able to login. If I try to login from the admin panel I get this:
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' '', '')' at line 4 in C:\xampp\htdocs\4images\includes\db_mysqli.php:76 Stack trace: #0 C:\xampp\htdocs\4images\includes\db_mysqli.php(76): mysqli_query(Object(mysqli), 'REPLACE INTO 4i...') #1 C:\xampp\htdocs\4images\includes\sessions.php(138): Db->query('REPLACE INTO 4i...') #2 C:\xampp\htdocs\4images\includes\sessions.php(179): Session->start_session('1', 1) #3 C:\xampp\htdocs\4images\admin\admin_global.php(105): Session->login('Frankie', '4rtttyggh5757DD', 0, 0) #4 C:\xampp\htdocs\4images\admin\index.php(6): require('C:\\xampp\\htdocs...') #5 {main} thrown in C:\xampp\htdocs\4images\includes\db_mysqli.php on line 76
kp:
I'm quite busy at the moment and can't dive deep in to this problem here.
But as the error mentioned, the SQL Syntax is wrong.
mysqli_query(Object(mysqli), 'REPLACE INTO 4i...')
Is the wrong statement.
I can't see the details after "4i..." there must be something wrong.
Here you can check the syntax:
https://mariadb.com/kb/en/replace/
Btw. here in the case could it be wrong to user_level and user_name to ''. So check if it is really correct
What is happen, when you remove the fix for the variables? It is working then and just the warnings occur?
Navigation
[0] Message Index
[*] Previous page
Go to full version