Jump to content

is this code is ok


Recommended Posts

<?php
    $get_pos = mysql_query("SELECT pos from player.item where owner_id='".$_SESSION['acc_id']."' AND `window` = 'MALL' ORDER BY id DESC");
    $pos = mysql_fetch_array($get_pos);
    $poss = $pos['pos'];
    $add_poss = 1;
    if($info['cash'] >= $item['pret'] && $poss == 0){
    
    $data = date('Y-m-d H:i:s');
    
    // LOG
    mysql_query("INSERT INTO itemshop.nuylog (nume_cumparator, item_cumparat, data_cumpararii) VALUES ('$user_id', '$items', '$data')");
    // Scădem Coins
    mysql_query("UPDATE account.account SET `coins` = `coins` - ".$item['pret']." WHERE `login` = '$user_id'");
    // Adăugăm JD
    mysql_query("UPDATE account.account SET `jcoins` = `jcoins` + ".$item['pret']." WHERE `login` = '$user_id'");
    // Insertăm Item-ul
    mysql_query("INSERT INTO player.item
                (owner_id,window,pos,count,vnum,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2)
                VALUES 
                ('$id_username','MALL','$add_poss','1','".$item['vnum']."','".$item['attrtype0']."', '".$item['attrvalue0']."', '".$item['attrtype1']."', '".$item['attrvalue1']."', '".$item['attrtype2']."', '".$item['attrvalue2']."', '".$item['attrtype3']."', '".$item['attrvalue3']."', '".$item['attrtype4']."', '".$item['attrvalue4']."', '".$item['attrtype5']."', '".$item['attrvalue5']."', '".$item['attrtype6']."', '".$item['attrvalue6']."', '".$item['socket0']."', '".$item['socket1']."', '".$item['socket2']."')");
?>

 

can you see is this code ok cause when i buy from my itemshop i dont get item on my inventory also my coin remail like past if it was 100 then it remain 100

 

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.