Hy everyone,I have an itemshop script,and it worked untill now, but I reinstalled the server because of some problemsand now it doesn't works anymore.Here are itemshop.php and is_buy.php .The problem is that I can buy multiple items,but only one appears in the itemshop inside the storekeeper,and sometimes,none.The space is occupied in the "MALL" but nothing appears in game.Can you tell me what is the problem please? I use profizocker94' SF .Thank you anticipated :handsdown:
IS_BUY.PHP
ITEMSHOP.PHP
IS_BUY.PHP
PHP Code:
<?PHP
if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
if(isset($_GET['id']) && checkInt($_GET['id'])) {
$sqlCmd="SELECT vnum, preis, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2 FROM ".SQL_HP_DB.".is_items WHERE id='".$_GET['id']."' LIMIT 1";
$sqlQry=mysql_query($sqlCmd,$sqlHp);
if(mysql_num_rows($sqlQry)==1) {
$getItem=mysql_fetch_object($sqlQry);
if($_SESSION['user_coins']>=$getItem->preis) {
$getGroesse = compareItems($getItem->vnum);
$belPos = checkPos($_SESSION['user_id']);
$possiblePos = findPos($belPos['islager'],$getGroesse['groesse']);
if(!empty($possiblePos)) {
$sqlCmd="UPDATE account.account SET coins=coins-".$getItem->preis." WHERE id='".$_SESSION['user_id']."' LIMIT 1";
$sqlQry=mysql_query($sqlCmd,$sqlServ);
$sqlLog="INSERT INTO ".SQL_HP_DB.".is_log (account_id,vnum,preis,zeitpunkt) VALUES ('".$_SESSION['user_id']."','".$getItem->vnum."','".$getItem->preis."','".$sqlZeit."')";
$qryLog=mysql_query($sqlLog,$sqlHp);
$sqlItem="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
('".$_SESSION['user_id']."','MALL','".$possiblePos[0]."','1','".$getItem->vnum."','".$getItem->attrtype0."', '".$getItem->attrvalue0."', '".$getItem->attrtype1."', '".$getItem->attrvalue1."', '".$getItem->attrtype2."', '".$getItem->attrvalue2."', '".$getItem->attrtype3."', '".$getItem->attrvalue3."', '".$getItem->attrtype4."', '".$getItem->attrvalue4."', '".$getItem->attrtype5."', '".$getItem->attrvalue5."', '".$getItem->attrtype6."', '".$getItem->attrvalue6."', '".$getItem->socket0."', '".$getItem->socket1."', '".$getItem->socket2."')";
$qryItem=mysql_query($sqlItem,$sqlServ) or die(mysql_error());
echo'<p class="meldung">Elementul a fost achizitionat cu succes! Daca elementul nu apare in Depozit(ItemShop), va rugam sa contactati un administrator.</p>';
}
else {
echo'<p>Nu aveti suficient spatiu in Depozit(ItemShop). Soldul dvs. nu sa schimbat.</p>';
}
}
else {
echo'<p class="meldung">Nu aveti suficiente Monede Dragon!</p>';
}
}
else {
echo'<p class="meldung">Elementul specificat nu exista.</p>';
}
}
else {
echo'<p class="meldung">Es wurde keine gültige ID eingegeben.</p>';
}
echo'<p><a href="javascript:history.back()">Inapoi</a></p>';
}
else {
echo'<p class="meldung">Trebuie sa fi logat.</p>';
}
?>
ITEMSHOP.PHP
PHP Code:
<?PHP
if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
if(isset($_GET['k']) && checkInt($_GET['k'])) {
$sqlCmdS="SELECT * FROM ".SQL_HP_DB.".is_items WHERE kategorie_id='".$_GET['k']."' ORDER BY id DESC";
}
else {
$sqlCmdS="SELECT * FROM ".SQL_HP_DB.".is_items ORDER BY id DESC";
}
?>
<div id="isleft">
<h2>Credit</h2>
<p><b><?PHP echo $_SESSION['user_coins']; ?> Coins</b></p>
<h2>Categorii</h2>
<ul>
<?PHP
$sqlCmd = "SELECT * FROM ".SQL_HP_DB.".is_kategorien ORDER BY titel ASC;";
$sqlQry = mysql_query($sqlCmd,$sqlHp);
while($getKats = mysql_fetch_object($sqlQry)) {
echo'<li><a href="index.php?s=itemshop&k='.$getKats->id.'">'.$getKats->titel.'</a></li>';
}
?>
</ul>
</div>
<div id="isright">
<h2>Item Shop</h2>
<table>
<?PHP
$sqlQry=mysql_query($sqlCmdS,$sqlHp);
while($getItems=mysql_fetch_object($sqlQry)) {
$aktItem = compareItems($getItems->vnum);
$itemStufe = (checkInt($aktItem['stufe'])) ? "+".$aktItem['stufe'] : '';
?>
<tr>
<th colspan="2" class="topLine"><?PHP echo $aktItem['item'].$itemStufe; ?> (<b><?PHP echo $getItems->preis; ?> Coins</b>)</th>
</tr>
<tr>
<td class="isImg">
<?PHP
if(!empty($getItems->bild)) echo'<img src="./is_img/'.$getItems->bild.'" title="'.$aktItem['item'].'" alt="'.$aktItem['item'].'"/>';
?>
</td>
<td class="tdunkel"><?PHP echo $getItems->beschreibung; ?></td>
</tr>
<tr>
<td colspan="2" class="isBuy"><a href="index.php?s=is_buy&id=<?PHP echo $getItems->id; ?>">Cumpara</a></td>
</tr>
<?PHP
}
?>
</table>
</div>
<?PHP
}
else {
echo'<p class="meldung">Trebuie sa fi logat!</p>';
}
?>