MysqliDb::escape PHP Method

escape() public method

Escape harmful characters which might affect a query.
public escape ( string $str ) : string
$str string The string to escape.
return string The escaped string.
    public function escape($str)
    {
        return $this->mysqli()->real_escape_string($str);
    }

Usage Example

コード例 #1
0
ファイル: add.php プロジェクト: ananay/seedup
 * @Last Modified by:   ananayarora
 * @Last Modified time: 2016-01-14 20:15:12
 */
session_start();
if (!isset($_SESSION['loggedin'])) {
    header("Location: signin.php?next=add.php");
}
if (isset($_POST['submit'])) {
    require 'conf.php';
    require 'sql.php';
    $c = new Conf();
    $o = new MysqliDb($c->host, $c->username, $c->password, $c->db);
    $insArr = array();
    foreach ($_POST as $key => $value) {
        if ($key == "valuation" || $key == "currentfunding") {
            $insArr[$key] = str_replace(",", "", $o->escape($value));
        } else {
            $insArr[$key] = $o->escape($value);
        }
    }
    $insArr['timeadded'] = time();
    $insArr['imageurl'] = 'data:image/png;base64,' . base64_encode(file_get_contents($_FILES['imageurl']['tmp_name']));
    unset($insArr['submit']);
    $o->insert("startups", $insArr);
    // header("Location: index.php");
}
require 'header.php';
?>
	<script src="http://clouddelivery.textbox.io/1/getEditor?apiKey=838eacr76gusx262p3cs4fwkjk104wsqun1nyelzulvy6okw"></script>
	<style type="text/css">
	textarea {
All Usage Examples Of MysqliDb::escape