PHP - Hazırlanan tablolar hata, neyin var?

0 Cevap php

Yani burada-bloğu bulunuyor:

        $query = "UPDATE users SET ?=? WHERE ?=?";

        $type = "s";
        $type .= substr(gettype($valname), 0, 1);
        $type .= 'i';

        if ( $smtp = $this->conn->prepare($query) )
        {
            $smtp->bind_param($type, $colname, $valname, 'id', 40);
            $smtp->execute();
            $smtp->close();

        }else
        {
            return $this->conn->error;

        }

For some reason it refuses to bind the parameters, and it gives me this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?=? WHERE ?=?' at line 1

I QuestionMarks etrafında backticks (`) veya singlequotes (') eklerseniz i yerine bu hatayı alıyorum:

Bilinmeyen sütun '?' in 'where yan tümcesi'

Herhangi bir fikir yanlış gitti ne? Ben tanrı bu sinir bozucu, onunla oynarken saatlerce burada oturuyorum!

Bir demet teşekkür!

0 Cevap