All symbols after & stripped
Posted
by user300413
on Stack Overflow
See other posts from Stack Overflow
or by user300413
Published on 2010-03-28T01:28:01Z
Indexed on
2010/03/28
1:33 UTC
Read the original article
Hit count: 258
My query:
mysql::getInstance()->update('requests', array('response' => mysql_real_escape_string($_POST['status'])), array('secret' => $_POST['secret'])); ?>
If i wand to add string with "&" symbol, all symbols after "&" stripped.
Example: string: !"?;%:?*()_+!@#$%^&*()_+
in database i see only: !"?;%:?*()_+!@#$%^
How to fix this?
update function, if anyone need:
function update($table, $updateList, $whereConditions)
{
$updateQuery = '';
foreach ($updateList as $key => $newValue) {
if (!is_numeric($newValue)) {
$newValue = "'" . $newValue . "'";
}
if (strlen($updateQuery) == 0) {
$updateQuery .= '`' . $key . '` = ' . $newValue;
} else {
$updateQuery .= ', `' . $key . '` = ' . $newValue;
}
}
return $this->query('UPDATE ' . $table . ' SET ' . $updateQuery . $this->buildWhereClause($whereConditions));
}
© Stack Overflow or respective owner