Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 12th October 2018, 14:52
BT-loader BT-loader is offline
Banned
 
Join Date: Jan 2010
China
Posts: 3
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 12th October 2018, 14:53
DND DND is online now
VIP
 
Join Date: Dec 2008
Posts: 1,241
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. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
  #3  
Old 12th October 2018, 15:45
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
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 (15th October 2018), Windocx (12th October 2018)
  #4  
Old 21st November 2018, 21:59
Tedmorris Tedmorris is offline
Senior Member
 
Join Date: Sep 2017
Posts: 62
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 (21st November 2018)
  #5  
Old 21st November 2018, 23:25
DND DND is online now
VIP
 
Join Date: Dec 2008
Posts: 1,241
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. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
The Following User Says Thank You to DND For This Useful Post:
Tedmorris (22nd November 2018)
  #6  
Old 22nd November 2018, 00:07
Tedmorris Tedmorris is offline
Senior Member
 
Join Date: Sep 2017
Posts: 62
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 22nd November 2018, 00:27
DND DND is online now
VIP
 
Join Date: Dec 2008
Posts: 1,241
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. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
The Following User Says Thank You to DND For This Useful Post:
Tedmorris (22nd November 2018)
  #8  
Old 23rd November 2018, 05:06
HDVinnie's Avatar
HDVinnie HDVinnie is offline
BluCrew
 
Join Date: Dec 2014
P2P
Posts: 140
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 24th November 2018, 22:04
Tedmorris Tedmorris is offline
Senior Member
 
Join Date: Sep 2017
Posts: 62
Default
No mate its not but the orignal source would be. Whats a PR?
Reply With Quote
  #10  
Old 25th November 2018, 01:28
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
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 18:31. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.