Deci am tabelele astea de jos :
Vreau sa afisez un text pe o pagina cu suma totala a banilor din wallet, suma totala a banilor din bank din tabela money (toti banii de pe server cum ar fi din wallet si toti banii de pe server din bank) si sa expun cel mai bogat jucator cu numele lui folosind idul sa pot extrage din tabela identity firstname si name!
Stiu ca este ceva usor pentru unii, dar eu nu am mai pus mana pe php de cativa ani :))! :omfg:
Ajutor afisare php
Moderators: Moderatori ajutatori, Moderatori
- Mafios_X
- Fost administrator
- Posts: 6851
- Joined: 10 Apr 2009, 01:28
- Detinator Steam: Da
- SteamID: mafiosx
- Reputatie: Fost Administrator
- Location: Italia
- Has thanked: 341 times
- Been thanked: 419 times
- Contact:
-------------------------------#STEAM PROFILE--------------------------------------
STEAM: mafiosx
www.gamescan.ro - Un fel de GameTracker ROMANESC :D
STEAM: mafiosx
www.gamescan.ro - Un fel de GameTracker ROMANESC :D
-
- Fost administrator
- Posts: 13713
- Joined: 09 Oct 2010, 12:39
- Detinator Steam: Da
- CS Status: In grajd!
- SteamID: kalulord
- Reputatie: Fost Administrator
Fost membru Club eXtreamCS (6 luni)
Nume anterior: Terra - Location: Romania, Ploiesti
- Has thanked: 328 times
- Been thanked: 646 times
- Contact:
Netestat!
Descarci de aici clasa mysql: https://raw.githubusercontent.com/Thing ... sqliDb.php
Descarci de aici clasa mysql: https://raw.githubusercontent.com/Thing ... sqliDb.php
Code: Select all
<?php
require_once ('MysqliDb.php');
$db = new MysqliDb (Array (
'host' => 'host',
'username' => 'username',
'password' => 'password',
'db'=> 'databaseName',
'port' => 3306,
'prefix' => 'my_',
'charset' => 'utf8'));
$richppl = $db->rawQueryValue ('SELECT table1.user_id, MAX(table1.wallet) AS MAXWALLET, MAX(table1.bank) AS MAXBANK, identity.firstname, identity.name
FROM table1
INNER JOIN identity ON table1.user_id = identity.user_id
LIMIT 10');
foreach ($richppl => $key) {
print_r($key);
print 'The richest user with wallet is: '.$key['name'].' with '.$key['maxwallet'].'';
}
?>
- Mafios_X
- Fost administrator
- Posts: 6851
- Joined: 10 Apr 2009, 01:28
- Detinator Steam: Da
- SteamID: mafiosx
- Reputatie: Fost Administrator
- Location: Italia
- Has thanked: 341 times
- Been thanked: 419 times
- Contact:
firstname si name sunt in alta tabela numita altfel, nu cu banii!
Nu-mi functioneaza!
Code: Select all
$richppl = $db->rawQueryValue ('SELECT user_id, MAX(wallet) AS MAXWALLET, MAX(bank) AS MAXBANK FROM vrp_user_moneys
INNER JOIN vrp_user_identities ON user_id = identity.user_id
LIMIT 10');
foreach ($richppl => $key) {
print_r($key);
print 'The richest user with wallet is: '.$key['name'].' with '.$key['maxwallet'].'';
-------------------------------#STEAM PROFILE--------------------------------------
STEAM: mafiosx
www.gamescan.ro - Un fel de GameTracker ROMANESC :D
STEAM: mafiosx
www.gamescan.ro - Un fel de GameTracker ROMANESC :D
- Mafios_X
- Fost administrator
- Posts: 6851
- Joined: 10 Apr 2009, 01:28
- Detinator Steam: Da
- SteamID: mafiosx
- Reputatie: Fost Administrator
- Location: Italia
- Has thanked: 341 times
- Been thanked: 419 times
- Contact:
Ma poate ajuta cineva? :)
Eventual sa extrag numele din baza de date! (platesc daca este nevoie, cautati-ma pe http://steamcommunity.com/id/mafios/ )
Eventual sa extrag numele din baza de date! (platesc daca este nevoie, cautati-ma pe http://steamcommunity.com/id/mafios/ )
-------------------------------#STEAM PROFILE--------------------------------------
STEAM: mafiosx
www.gamescan.ro - Un fel de GameTracker ROMANESC :D
STEAM: mafiosx
www.gamescan.ro - Un fel de GameTracker ROMANESC :D
-
- Utilizator neserios
- Posts: 847
- Joined: 02 Nov 2014, 18:21
- Detinator Steam: Da
- CS Status: Citesc forumul eXtreamCS.com...!
- Reputatie: Fost Scripter eXtreamCS
Utilizator neserios - Fond eXtream: 0
- Location: Constanta
- Has thanked: 40 times
- Been thanked: 30 times
iti recomand sa folosesti conexiunea prin PDO este mult mai buna.
Un exemplu:
Daca doresti ai un link in descriere cu un topic in care ofer servici php.
Un exemplu:
Code: Select all
<?php
$q = Config::$g_con->prepare("SELECT coloana FROM tabel WHERE coloana = 0"); // inclod de = 0 pui tu ce doresti
$q->execute();
echo $q->RowCount() afiseaza ce ai in $q adica mai sus
Config // clasa
g_con // este "variabila" prin care se face conexiunea ( nu stiu exact cum sa ii spun )
?>
https://discord.gg/VABVdhXMrK ZM CSO server in working..
- Mafios_X
- Fost administrator
- Posts: 6851
- Joined: 10 Apr 2009, 01:28
- Detinator Steam: Da
- SteamID: mafiosx
- Reputatie: Fost Administrator
- Location: Italia
- Has thanked: 341 times
- Been thanked: 419 times
- Contact:
Diversity wrote:iti recomand sa folosesti conexiunea prin PDO este mult mai buna.
Un exemplu:
Daca doresti ai un link in descriere cu un topic in care ofer servici php.Code: Select all
<?php $q = Config::$g_con->prepare("SELECT coloana FROM tabel WHERE coloana = 0"); // inclod de = 0 pui tu ce doresti $q->execute(); echo $q->RowCount() afiseaza ce ai in $q adica mai sus Config // clasa g_con // este "variabila" prin care se face conexiunea ( nu stiu exact cum sa ii spun ) ?>
Ti-am trimis un PM!
-------------------------------#STEAM PROFILE--------------------------------------
STEAM: mafiosx
www.gamescan.ro - Un fel de GameTracker ROMANESC :D
STEAM: mafiosx
www.gamescan.ro - Un fel de GameTracker ROMANESC :D
- Hades Ownage
- Membru eXtream
- Posts: 3182
- Joined: 22 Oct 2008, 10:12
- Detinator Steam: Da
- Detinator server CS: jb.clutch.ro
- SteamID: hades-source
- Reputatie: Fost Super Moderator
Fost Scripter eXtreamCS
Nume anterior: hadesownage - Location: Iasi
- Has thanked: 324 times
- Been thanked: 406 times
Code: Select all
SELECT MAX(m.wallet) as total_money, (SELECT user_id FROM money ORDER BY wallet DESC LIMIT 1) as highest, i.firstname, i.name FROM money m LEFT OUTER JOIN identity i ON i.user_id = highest
-
- Information
-
Who is online
Users browsing this forum: [M]Maasym, A k c 3 n 7, Dot [Bot], fentezzzzz, florin_nfc, hockz94, Radu eXtream and 370 guests