04-23-2012, 01:28 AM
this is completely wrong if you need help add me on skype: ) if you need a more immediate
response here keep in mind i dont know exactly what your trying to accomplish the following
would remove the item if you give it a $item value 0-4 and i use this in my itemremove
function if anything your result would look similar to this but with a different in the query etc
<?php
mysql_select_db( $SiteSQL["config-database_db"] , $Site_sqlcon) or die( mysql_error() );
$update = mysql_query();
$lastdigit = (substr($characterid, -1, 1));
$table = ("`t_inven0$lastdigit`");
$qry =("UPDATE `".$SiteSQL["config-database_db"]. "`.$table SET `a_item_idx$item` = 0 WHERE $table.`a_char_idx` =$chaid AND $table.`a_tab_idx` =$itemtype AND $table.`a_row_idx` =$row;");
$cqry = ("select `a_item_idx$item` from `".DB. "`.$table WHERE $table.`a_char_idx` =$chaid AND $table.`a_tab_idx` =$itemtype AND $table.`a_row_idx` =$row;");
if(mysql_result(mysql_query($cqry), 0) <= 0)
{echo "There is no item there"; return;}
$insert = mysql_query($qry);
if(!$insert)
{
echo "failed to reset item contact dev";
}
else
{
echo "Successfully Reset";
}
return;
?>
