The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coding source
#4
Here's how I would handle that. The UserSpice 4 classes are more secure and more universal with PDO and they're also better documented.

1. I would download the latest userspice 4.1.4
2. Go to users/classes/DB.php and copy that class to your usercake folder somewhere.
3. Edit the class lines 26-30 from
Code:
$this->_pdo = new PDO('mysql:host=' .
Code:
Config::get('mysql/host') .';dbname='.
Code:
Config::get('mysql/db'),
Code:
Config::get('mysql/username'),
Code:
Config::get('mysql/password'),
to
Code:
$this->_pdo = new PDO('mysql:host=YOURHOSTNAME,;dbname=YOURDBNAME,YOURdbUSERNAME,YOURdbPASSWORD,

4. Then include the new DB class into your project. It shouldn't affect how the core usercake stuff works and then for all the stuff you do moving forward, you can use the modern PDO way of doing things that are documented here.

http://userspice.org/documentation-db-class-2/

If that doesn't work, let me know.
  Reply


Messages In This Thread
Coding source - by picassoo - 09-08-2016, 10:39 AM
Coding source - by mudmin - 09-08-2016, 11:37 AM
Coding source - by picassoo - 09-08-2016, 04:56 PM
Coding source - by mudmin - 09-08-2016, 05:58 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)