Hello everyone,
I want to do with mysql in mysqli. I use the TS 2.5 by xam and is fully modded, when i change this i get white page what am i doing wrong. Thank you
fuctions.php
mysql
Code:
function dbconn($autoclean = false){global $mysql_host, $mysql_user, $mysql_pass, $mysql_db;if (!@mysql_pconnect($mysql_host, $mysql_user, $mysql_pass)){switch (mysql_errno()){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=700 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>");elsedie("Too many users. Please press the Refresh button in your browser to retry.");default:die("[" . mysql_errno() . "] dbconn: mysql_pconnect: " . mysql_error());}}mysql_select_db($mysql_db)or die('dbconn: mysql_select_db: ' + mysql_error());
mysqli
Quote:
function dbconn ($autoclean = false){global $mysqli_host, $mysqli_user, $mysqli_pass, $mysqli_db;if (!@($GLOBALS["___mysqli_ston"] = mysqli_connect['mysqli_host'], ['mysqli_user'], ['mysqli_pass'], ['mysqli_db'])){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 width='100%' height='100%' border='0'><tr><td><h3 align='center'>The Server Load is Very High at the moment. Retrying, please wait...</h3></td></tr></table></body></html>");elsedie("Too many users. Please press the Refresh button in your Browser to retry.");default:die('Unable to connect to the database [' . mysqli_connect_error() . ']');}}mysqli_query($GLOBALS["___mysqli_ston"], "USE ['mysqli_db']")) or die('db_connect: mysqli_select_db: ' + mysqli_connect_error();
|
include/config.php
Quote:
readconfig('DATABASE');$mysqli_host = $DATABASE['mysqli_host'];$mysqli_user = $DATABASE['mysqli_user'];$mysqli_pass = $DATABASE['mysqli_pass'];$mysqli_db = $DATABASE['mysqli_db'];
|
config/DATABASE
Quote:
a:4:{s:10:"mysqli_host";s:9:"localhost";s:10:"mysq li_user";s:14:"user";s:10:"mysqli_pass";s:11:"pass word";s:8:"mysqli_db";s:14:"phpmyadmin";}
|