Reborn Fail Pls help me
#8

the file should look like

function DeductNas($cid, $amount)
{
global $LC_Db; global $con_cms_pdo;
$query = sprintf
("
Update
%s.t_characters
SET
a_nas = a_nas - :amount
WHERE
a_index = :cidindex
AND
a_enable = 1
", $LC_Db );
$dbh = $con_cms_pdo->prepare( $query );
$dbh->execute( array( ':amount' => $amount ,':cidindex' => $cid ));
}
function GetitemBalance( $cid, &$invRow, &$invCol, &$invAmount )
{
global $LC_Db; global $con_cms_pdo;
$l = substr($cid, -1);
$query = sprintf
("
SELECT
a_item_idx0,
a_item_idx1,
a_item_idx2,
a_item_idx3,
a_item_idx4,
a_count0,
a_count1,
a_count2,
a_count3,
a_count4,
a_row_idx

FROM
%s.t_inven0".$l."
WHERE
a_char_idx = :cidindex
", $LC_Db );
$dbh = $con_cms_pdo->prepare( $query );
$dbh->execute( array( ':cidindex' => $cid ));
$invRow = -1;
$invCol = -1;
$invAmount = 0;

while( $row = $dbh->fetch() )
{
$r = $row['a_row_idx'];
for( $c=0; $c<5; $c++ )
{
if( $row['a_item_idx'.$c] == 9999 )
{
$invRow = $r;
$invCol = $c;
$invAmount = $row['a_count'.$c];
}
}
}
}
function DeductItem($cid, $row, $col, $amount)
{
$l = substr($cid, -1);
global $LC_Db; global $con_cms_pdo;
$query = sprintf
("
UPDATE
%s.t_inven0%d

SET
a_count%d = %s

WHERE
a_char_idx = '%s'

AND
a_row_idx = '%s'

", $LC_Db,
$l,
$col,
$amount,
$cid,
$row );
$dbh = $con_cms_pdo->prepare( $query );
$dbh->execute();
}

function GetGoldBalance( $cid, &$invRow, &$invCol, &$invAmount )
{
global $LC_Db; global $con_cms_pdo;
$l = substr($cid, -1);
$query = sprintf
("
SELECT

hope you serve



Messages In This Thread
[No subject] - by JensMannheim - 03-13-2015, 12:38 PM
[No subject] - by Asgar - 03-13-2015, 09:55 PM
[No subject] - by JensMannheim - 03-14-2015, 01:25 AM
[No subject] - by devlopianer - 03-14-2015, 02:58 PM
[No subject] - by Asgar - 03-17-2015, 03:28 AM
[No subject] - by devlopianer - 03-17-2015, 07:37 AM
[No subject] - by devlopianer - 03-17-2015, 08:11 AM
[No subject] - by Asgar - 03-17-2015, 06:29 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)