Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Posts
    46

    Unanswered: Dynamic Update problem

    Hi,

    I need to create a dynamic Update and i tried the following:

    String SQLstr = "UPDATE " + TABLENAME + " FIELDS ( " +
    "Title, Text ) VALUES ( 'xxx','yyy' ) WHERE ArticleID = " + Id;

    It will be dynamic caues Fields and values I should place an arrays of Names and values accordingly.

    But this simple query wont work.
    Does Mysql supports that syntax?

    I have no idea how to do it dynamic with Set Title = 'xxx' syntax, so i prefer the above syntax.
    The code is written in a Java application (not PHP).

    Thanks

  2. #2
    Join Date
    Mar 2003
    Location
    Dortmund, Germany
    Posts
    18
    Uhm... I don't know your syntax, but perhaps you can use:

    replace into $table ($col1,$col2) values ($val1,$val2)
    or
    update $table set $col1=$val1,$col2=$val2

    ?

  3. #3
    Join Date
    Aug 2002
    Posts
    46
    Cheers mate,
    I am working on it.....


    Originally posted by Blafasel
    Uhm... I don't know your syntax, but perhaps you can use:

    replace into $table ($col1,$col2) values ($val1,$val2)
    or
    update $table set $col1=$val1,$col2=$val2

    ?

Posting Permissions

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