Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Location
    Canada
    Posts
    57

    Unanswered: Adding content...

    Hi there!

    Could somebody explain what is the right PHP syntax for a query which can update a MySQL table field by ADDING a content to it WITHOUT deleting/replacing its existing content?

    Many thanks in advance for your help!

    Best regards,

    Gerry

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i expect the php syntax will be the same no matter what the query it's executing

    you're probably asking about the mysql query syntax, right?
    Code:
    UPDATE daTable
       SET somecharcolumn = CONCAT(somecharcolumn,' this added to the end')
     WHERE sumfin = 'summat'
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    or even
    INSERT into mytable (columnlist) values(valueslist)

    the syntax with PHP is the same as any SQL statement @mysql_query(sqlstatement,connectiontoserver)
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •