php - Error on Insert clause: Unknown column '$variableName' in 'field list' -
edit: read answers below before reading incorrect sql knowledge lol
so i'm trying insert variable , reason thinks it's column, though have in single quotes. doing wrong? time.
unknown column '$emailaddress' in 'field list'] in execute("update mailer_recipients set email_address=$emailaddress id=539") $sql = 'update ' . $this->recipientdbtable . ' set ' . $this->recipientdbcolumn['result_id'] . '=' . '$hash' . ' ' . $this->recipientdbcolumn['id'] . '=' . $this->emailid; $sql = 'update ' . $this->recipientdbtable . ' set ' . $this->recipientdbcolumn['address'] . '=' . '$emailaddress' . ' ' . $this->recipientdbcolumn['id'] . '=' . $this->emailid;
try this:
$sql = "update {$this->recipientdbtable} set {$this->recipientdbcolumn['result_id']} = '{$hash}' {$this->recipientdbcolumn['id']} = {$this->emailid}";
have read on difference between single , double quotes.
Comments
Post a Comment