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
#1
Hi! You can post all the elements for INSERT, SELECT, EDIT(UPDETING), DELETE and COUNT funcs? separete from the all the script. userspace from userusercake is diferent built, and I cant not undesturd Sad

I will like to cont tiket (1) readand not (0) read.

<pre>
Code:
function counthelptiket()
{
    global $mysqli,$db_table_prefix;
    $stmt = $mysqli->prepare("SELECT COUNT(*) FROM ".$db_table_prefix."help_tiket
</pre>
WHERE st_ne_citit = 0 ");
$stmt->execute();
$stmt->bind_result($st_ne_citit);
while ($stmt->fetch()){
$row[$page] = array('st_ne_citit' => $st_ne_citit);
}
$stmt->close();
if (isset($row)){
return ($row);
}
}`
  Reply
#2
What version of UserSpice or UserCake are you using? This is done differently in different versions.
  Reply
#3
I have UserCake
  Reply
#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


Forum Jump:


Users browsing this thread: 2 Guest(s)