Bravo List
Register
Go Back   > Bravo List > Source Code > Trackers > TBDev
Reply
  #1  
Old 12-10-18, 14:52
BT-loader's Avatar
BT-loader BT-loader is offline
Member
 
Join Date: Jan 2010
Sweden
Posts: 1
Default Doesn't work with mysqli! (how to fix)
Is there anyone who has go this to work with the forced use of mysqli?
Reply With Quote
  #2  
Old 12-10-18, 14:53
DND's Avatar
DND DND is offline
Support
 
Join Date: Dec 2008
Posts: 1,057
Default
simple.. change all your code to mysqli
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. TBDev Support
  5. Gazelle Support Install
  6. TSSE Install Support
Reply With Quote
  #3  
Old 12-10-18, 15:45
Napon's Avatar
Napon Napon is offline
Senior Member
 
Join Date: Feb 2016
P2P
Posts: 361
Default
OK pm me what code and all I can mysqli it for you


If you wait 2 weeks I'll be uploading my FMEDITION 18 mysqli to my github
Reply With Quote
The Following 2 Users Say Thank You to Napon For This Useful Post:
BT-loader (15-10-18), Windocx (12-10-18)
  #4  
Old 21-11-18, 21:59
Tedmorris's Avatar
Tedmorris Tedmorris is offline
Senior Member
 
Join Date: Sep 2017
Posts: 45
Default
Besides changing mysql_* calls to mysqli_* what are the functions that need to be updated etc. Ive seen some TBDEV mods with mysqli_* but cant seem to find any showing the updated functions related to the db like dbconn()
Reply With Quote
The Following User Says Thank You to Tedmorris For This Useful Post:
Johnny Utah (21-11-18)
  #5  
Old 21-11-18, 23:25
DND's Avatar
DND DND is offline
Support
 
Join Date: Dec 2008
Posts: 1,057
Default
if you use standard tbdev.. this should do the trick


Code:
function dbconn($autoclean = false)
{
global $TBDEV;

if (!@($GLOBALS["___mysqli_ston"] = mysqli_connect($TBDEV['mysql_host'],  $TBDEV['mysql_user'],  $TBDEV['mysql_pass'])))
{
switch (((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_errno($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false)))
{
case 1040:
case 2002:
if ($_SERVER['REQUEST_METHOD'] == "GET")
die("<html><head><meta http-equiv='refresh' content=\"5 $_SERVER[REQUEST_URI]\"></head><body><table border='0' width='100%' height='100%'><tr><td><h3 align='center'>The server load is very high at the moment. Retrying, please wait...</h3></td></tr></table></body></html>");
else
die("Too many users. Please press the Refresh button in your browser to retry.");
default:
die("[" . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_errno($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false)) . "] dbconn: mysql_connect: " . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
}
}
((bool)mysqli_query($GLOBALS["___mysqli_ston"], "USE {$TBDEV['mysql_db']}"))
or die('dbconn: mysql_select_db: ' . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));

userlogin();

if ($autoclean)
register_shutdown_function("autoclean");
}
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. TBDev Support
  5. Gazelle Support Install
  6. TSSE Install Support
Reply With Quote
The Following User Says Thank You to DND For This Useful Post:
Tedmorris (22-11-18)
  #6  
Old 22-11-18, 00:07
Tedmorris's Avatar
Tedmorris Tedmorris is offline
Senior Member
 
Join Date: Sep 2017
Posts: 45
Default
Thx DND, i use a heavy modified TBsource but that should do the trick, is there anything else that needs to be changed? And one last thing, i notice some calls are not changed in some code, how do i tell which ones to leave as mysql_* and which ones to change to mysqli_* ?
Reply With Quote
  #7  
Old 22-11-18, 00:27
DND's Avatar
DND DND is offline
Support
 
Join Date: Dec 2008
Posts: 1,057
Default
Basic example:


Code:
mysql_query('SELECT username FROM users WHERE id = ' . sqlesc($user['invitedby']));
will become

Code:
mysqli_query($GLOBALS["___mysqli_ston"], 'SELECT username FROM users WHERE id = ' . sqlesc($user['invitedby']));

same query, just a bit changed
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. TBDev Support
  5. Gazelle Support Install
  6. TSSE Install Support
Reply With Quote
The Following User Says Thank You to DND For This Useful Post:
Tedmorris (22-11-18)
  #8  
Old 23-11-18, 05:06
HDVinnie's Avatar
HDVinnie HDVinnie is offline
BluCrew
 
Join Date: Dec 2014
P2P
Posts: 119
Default
Quote:
Originally Posted by Tedmorris View Post
Thx DND, i use a heavy modified TBsource but that should do the trick, is there anything else that needs to be changed? And one last thing, i notice some calls are not changed in some code, how do i tell which ones to leave as mysql_* and which ones to change to mysqli_* ?
Is this version on GitHub? Would make it easier to make a PR to show changes needed.
Reply With Quote
  #9  
Old 24-11-18, 22:04
Tedmorris's Avatar
Tedmorris Tedmorris is offline
Senior Member
 
Join Date: Sep 2017
Posts: 45
Default
No mate its not but the orignal source would be. Whats a PR?
Reply With Quote
  #10  
Old 25-11-18, 01:28
Napon's Avatar
Napon Napon is offline
Senior Member
 
Join Date: Feb 2016
P2P
Posts: 361
Default
mine is on github to mysqli
Reply With Quote
Reply

Tags
fix , mysqli , work

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 07:30. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2019, vBulletin Solutions Inc.