Quote:
Originally Posted by Sheepdude
For SQLite 3 you need to use PDO. In config.php, replace:
Config.php:
Old code
Code:
$conexao = mysql_pconnect($host,$bd_user,$bd_password) or die($msg[0]);
mysql_select_db($bd,$conexao) or die($msg[1]);
New code
Code:
$conexao = new PDO('sqlite:up/rankme.sq3') or die($msg[0]);
In restore.php, make sure all the database strings make sense in terms of the directory location, and switch all instances of rank.sql to rankme.sq3. Example below:
Config.php:
Code:
$ftpDIR = "ftproot/css/addons/sourcemod/data/sqlite";
Restore.php:
Old code (example)
Code:
if (ftp_get($conn_id, "up/rank.sql", $ftpDIR . "/rank.sql", FTP_BINARY)) {
New code (example)
Code:
if (ftp_get($conn_id, "up/rankme.sq3", $ftpDIR . "/rankme.sq3", FTP_BINARY)) {
Index.php:
Old code
Code:
$resultado1 = mysql_query($query1,$conexao);
echo "<table id='table1'><tr><th>POSITION</th><th>NAME</th><th>STEAMID</th><th>SCORE</th><th>KDR</th><th>HEADSHOTS</th><th>ACCURACY</th></td>";
$rank=0;
while ($row = mysql_fetch_array($resultado1)) {
New code
Code:
$resultado1 = $conexao->query($query1);
echo "<a href='http://www.clan-psycho.com'><img src='http://www.clan-psycho.com/Themes/insidv2/images/theme/logo.png' /></a><br /><br />";
echo "<table id='table1'><tr><th>POSITION</th><th>NAME</th><th>STEAMID</th><th>SCORE</th><th>KDR</th><th>HEADSHOTS</th><th>ACCURACY</th></td>";
$rank=0;
while ($row = $resultado1->fetch()) {
Here is what the working web interface should look like:
http://www.clan-psycho.com/rank
|
Obrigado, mas recebo esse erro direto da console no linux, ao abrir o banco de dados.
[root@server sqlite]# sqlite rankme.sq3
Unable to open database "rankme.sq3": file is encrypted or is not a database