[thelist] [sql] append function?

shawn allen shawn at alterior.net
Tue Jan 7 18:14:01 CST 2003


quoth Paul Bennett:
> you mean like this (sql statement)
>
> $sql = "update $jobsTable set partsUsed = partsUsed.'$newData' where
> reference = '$id' limit 1";
> ?
>
> this throws an error in mysql (syntax error)

MySQL doesn't have a concatenation operator. Try the CONCAT() function:

UPDATE foo SET bar = CONCAT(baz, "qux") ...

Each RDBMS seems to have its own method of doing it. PostgreSQL's
concatenation operator is '||'. If in doubt, refer to your vendor's
documentation :)

--
shawn allen
  mailto://shawn@alterior.net
  phone://415.577.3961
  http://alterior.net
  aim://shawnpallen




More information about the thelist mailing list