How can i get a variable with php?

MrSky

New member
Messages
25
Points
0
Emulator
Hi guys!

How can i show a variable from mysql on fluxcp with php?

I.e. show #cashpoint on fluxcp?

 
show the result of the query in php

 
$sql = "SELECT *value* FROM {$server->loginDatabase}.*cashpointTable* ORDER BY id DESC ";
$sth = $server->connection->getStatement($sql);
$sth->execute();
$cash = $sth->fetchAll();
 
here is a sample
default_smile.png

 
I want show people cash on Donate page of fluxcp, instead of credit point

Code:
<span class="balance-text">ROPs</span><span class="balance-amount"><?php echo number_format(ropS) ?></span>
 
 
here is a sample 
default_smile.png

I'm trying this now, but dont show

Code:
<?php 		$sql = "SELECT *value* FROM {$server->loginDatabase}.`global_reg_value` where `account_id` = `2000000` and `str` = `#CASHPOINTS`"; 		$sth = $server->connection->getStatement($sql);		$sth->execute();		$cash = $sth->fetchAll();	?>	<span class="balance-text">ROPs</span>	<span class="balance-amount"><?php echo number_format($cash) ?></span>
 
Last edited by a moderator:
well if you research you can get it right but for now i will give you the answer

$sql = "SELECT value FROM {$server->loginDatabase}.global_reg_value WHERE account_id=? and str ='#CASHPOINTS'";
$sth = $server->connection->getStatement($sql);
$sth->execute(array($session->account->account_id));
$res = $sth->fetch();
$curr_points = $res->value;
 
use this echo
 
<?php echo $curr_points; ?>
 
hope this helps
 
Last edited by a moderator:
Back
Top