Results 1 to 4 of 4

 

Thread: php/mysql insert problem

  1. #1
    Driving to win

    Status
    Offline
    Join Date
    Aug 2003
    Location
    If I'm not at home, I'm in hospital
    Posts
    7,370
    Thanks
    7
    Thanked 16 Times in 11 Posts


    Hi

    I'm having a problem with php/mysql

    if I use insert into table values (xxx,xxx) everything works fine but if I use
    insert into table set a=x, b=y, c=z

    each new record gets inserted into the table 3 times

    Anyone had this happen to them before?

    and if so what is the solution - I know I can change all of the statements to use the values () syntax but I'd rather understand why the other one doesn't work.
    Never argue with idiots. They just drag you down to their level and then beat you with their experience.

    If ignorance is bliss then some of the people I know must be orgasmic.

  2. #2
    Can't Touch This

    Status
    Offline
    Join Date
    May 2004
    Location
    КРОМИДОВО
    Posts
    321
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hmm, works fine for me like this

    INSERT INTO table SET a = 'x' , b = 'y' , c = 'z';

    So I can't see your problem

    (absolutely no help whatsoever )

  3. #3
    Driving to win

    Status
    Offline
    Join Date
    Aug 2003
    Location
    If I'm not at home, I'm in hospital
    Posts
    7,370
    Thanks
    7
    Thanked 16 Times in 11 Posts
    Thanks
    Never argue with idiots. They just drag you down to their level and then beat you with their experience.

    If ignorance is bliss then some of the people I know must be orgasmic.

  4. #4
    Driving to win

    Status
    Offline
    Join Date
    Aug 2003
    Location
    If I'm not at home, I'm in hospital
    Posts
    7,370
    Thanks
    7
    Thanked 16 Times in 11 Posts
    Just for information I found from examining the server logs the problem was occuring due to the browser reloading the page - so I've now moved the insert code to a small php file on its own with a redirect to the confirmation page and that's working fine.
    Never argue with idiots. They just drag you down to their level and then beat you with their experience.

    If ignorance is bliss then some of the people I know must be orgasmic.



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Content Relevant URLs by vBSEO 3.5.0 RC2