04-23-2012, 04:56 AM
i would recommed using PDO as it protects u from mysql injections
$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;");
To do this in a safe way it would look something like this
if( ctype_digit( $characterid ) && ctype_digit( $row ) && cype_digit( $itemtype ) )
{
$query = sprintf
("
UPDATE
%s.t_inven0%d
SET
a_item_idx%d = 0
WHERE
a_char_idx = :charid
AND
a_tab_idx = :itemtype
AND
a_row_idx = :row
", $SiteSQL[config-database_db],
$lastdigit,
$item );
$dbh = $db->prepare($query);
$dbh->execute( array( :charid => $characterid,
:itemtype => $itemtype,
:row => $row ));
}

