2016-02-27 104 views
0

你好stackoverflow社區,我需要幫助這個mysqli查詢。我的汽車增長列在數據庫例如00001這樣填零元素,當我嘗試這樣的查詢:mysqli查詢與zerofill

$stmt = $mysqli->query("UPDATE ".$db_table_prefix."korteles 
    SET 
    vardas = '".$this->clean_k_name."', 
    pavard = ".$this->clean_k_surname.", 
    WHERE korteles_nr = '00001'"); 

我得到錯誤:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE korteles_nr = 00001' at line 18

我解決這個問題的搜索互聯網。但找不到所以請幫忙!

回答

1

查詢應該是這樣的: -

$stmt = $mysqli->query("UPDATE ".$db_table_prefix."korteles 
    SET 
    vardas = '$this->clean_k_name', 
    pavard = '$this->clean_k_surname' 
    WHERE 
     korteles_nr = '00001'"); 

你有後$this->clean_k_surname可變

刪除逗號