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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -