Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    2

    Question Unanswered: update query with php

    Hi all
    i have a problem with my update query in php , i try to update the last record , i try with this but update all the records and not only the last i dont know what´s wrong ...any ideas?


    $query = "UPDATE table1 SET Object1='one', Object2='two', Object3='three' WHERE id=LAST_INSERT_ID(table1.id)";


    thanks a lot

  2. #2
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    $query = "UPDATE table1 SET Object1='one', Object2='two', Object3='three' WHERE id=LAST_INSERT_ID()";

    LAST_INSERT_ID() with an argument return the value of the argument
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

  3. #3
    Join Date
    Oct 2003
    Posts
    2

    Unhappy

    i really have problems with that i do query but dont work ( dont make any update ) tell my plz if i have a sintaxys error or a concept mistake

    $query = "UPDATE $table SET pregunta1='one', pregunta2='two', pregunta3='three' WHERE id=LAST_INSERT_ID()";

  4. #4
    Join Date
    Nov 2003
    Location
    sweden
    Posts
    17
    test to write you query like this one

    $query = "UPDATE $table SET (pregunta1,pregunta2,pregunta3 )= ('one','two','three' ) WHERE id=LAST_INSERT_ID()";
    Linux

Posting Permissions

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