Professional Web Applications Themes

PHP/mySQL freakish error - PHP Development

I have never in my life ever seen this happen, but I am doing a typical mySQL insert statement: insert into nnet_usermetadata ( ... ) values ( ..... ) if (!mysql_query(sql)) { // DO STUFF} the ID column field, nnet_userid, is an int auto-increment. This is where I have never in my career seen this happen before. The INSERT statement, upon execution, literally writes on top of another existing row, so instead of 5 or 6 rows I have only 1 row, same ID, values changed! The way it works is that once a new user is pre-registered, their information ...

  1. #1

    Default PHP/mySQL freakish error

    I have never in my life ever seen this happen, but I am doing a typical
    mySQL insert statement:

    insert into nnet_usermetadata (
    ...
    ) values (
    .....
    )

    if (!mysql_query(sql)) { // DO STUFF}

    the ID column field, nnet_userid, is an int auto-increment.

    This is where I have never in my career seen this happen before. The INSERT
    statement, upon execution, literally writes on top of another existing row,
    so instead of 5 or 6 rows I have only 1 row, same ID, values changed!

    The way it works is that once a new user is pre-registered, their
    information is stored in the db, a cookie is set with their userID (the
    infamous permanent cookie) and then they're shown a screen w/ link to click
    to go to the next page. They can then click onto the "Registrer" link and
    edit their pre-registration information based upon the cookie stored in
    their machine and submit. Once submitted this time it updates their
    information instead of inserts.

    I've checked my code and writing on top of an existing row should NOT happen
    unless a cookie is set on their machine with their userid. In short, if I
    pre-register for the first time I should have a cookie with userid of 1. If
    Sven pre-registers for the first time on HIS machine he should have a cookie
    with userid of 2. and so on.

    So, uh, HELP!

    Phil


    Phil Powell Guest

  2. #2

    Default Re: PHP/mySQL freakish error

    your code probably has errors
    why dont you let us see so we can help you more?

    "Phil Powell" <soazineerols.com> wrote in message
    news:3Q26b.122081$xf.26618lakeread04...
    > I have never in my life ever seen this happen, but I am doing a typical
    > mySQL insert statement:
    >
    > insert into nnet_usermetadata (
    > ...
    > ) values (
    > ....
    > )
    >
    > if (!mysql_query(sql)) { // DO STUFF}
    >
    > the ID column field, nnet_userid, is an int auto-increment.
    >
    > This is where I have never in my career seen this happen before. The
    INSERT
    > statement, upon execution, literally writes on top of another existing
    row,
    > so instead of 5 or 6 rows I have only 1 row, same ID, values changed!
    >
    > The way it works is that once a new user is pre-registered, their
    > information is stored in the db, a cookie is set with their userID (the
    > infamous permanent cookie) and then they're shown a screen w/ link to
    click
    > to go to the next page. They can then click onto the "Registrer" link and
    > edit their pre-registration information based upon the cookie stored in
    > their machine and submit. Once submitted this time it updates their
    > information instead of inserts.
    >
    > I've checked my code and writing on top of an existing row should NOT
    happen
    > unless a cookie is set on their machine with their userid. In short, if I
    > pre-register for the first time I should have a cookie with userid of 1.
    If
    > Sven pre-registers for the first time on HIS machine he should have a
    cookie
    > with userid of 2. and so on.
    >
    > So, uh, HELP!
    >
    > Phil
    >
    >

    anti-bozak Guest

  3. #3

    Default Re: PHP/mySQL freakish error

    anti-bozak wrote:
    > your code probably has errors
    > why dont you let us see so we can help you more?
    >
    Particulary the definition for this particular table. To Phil: have you
    tried doing a dump of the actual SQL statements that you are sending to
    your server? Many problems arise there that becomes rather obvious looking
    at the raw SQL statements directly.

    -Fred

    --
    Shameless plug:
    [url]http://JobMarketIntelligence.com[/url]
    A database of high-tech firms at your fingertips.
    Fred Guest

  4. #4

    Default Re: PHP/mySQL freakish error

    The immediate red-flag I see is that (sql) should probably be ($sql), eh?

    -Paul Bramscher


    Phil Powell wrote:
    > I have never in my life ever seen this happen, but I am doing a typical
    > mySQL insert statement:
    >
    > insert into nnet_usermetadata (
    > ...
    > ) values (
    > ....
    > )
    >
    > if (!mysql_query(sql)) { // DO STUFF}
    >
    > the ID column field, nnet_userid, is an int auto-increment.
    >
    > This is where I have never in my career seen this happen before. The INSERT
    > statement, upon execution, literally writes on top of another existing row,
    > so instead of 5 or 6 rows I have only 1 row, same ID, values changed!
    >
    > The way it works is that once a new user is pre-registered, their
    > information is stored in the db, a cookie is set with their userID (the
    > infamous permanent cookie) and then they're shown a screen w/ link to click
    > to go to the next page. They can then click onto the "Registrer" link and
    > edit their pre-registration information based upon the cookie stored in
    > their machine and submit. Once submitted this time it updates their
    > information instead of inserts.
    >
    > I've checked my code and writing on top of an existing row should NOT happen
    > unless a cookie is set on their machine with their userid. In short, if I
    > pre-register for the first time I should have a cookie with userid of 1. If
    > Sven pre-registers for the first time on HIS machine he should have a cookie
    > with userid of 2. and so on.
    >
    > So, uh, HELP!
    >
    > Phil
    >
    >
    Paul Bramscher Guest

Similar Threads

  1. Replies: 0
    Last Post: January 29th, 02:03 PM
  2. MySQL ODBC error
    By jbogren in forum Coldfusion Database Access
    Replies: 9
    Last Post: December 1st, 06:17 PM
  3. mySQL error
    By khansab in forum Dreamweaver AppDev
    Replies: 14
    Last Post: September 16th, 10:04 PM
  4. MySql connect error
    By pogothedog1000 in forum Coldfusion Database Access
    Replies: 0
    Last Post: June 24th, 01:20 AM
  5. mySQL error in PHP that works directly in mySQL
    By jcg in forum PHP Development
    Replies: 2
    Last Post: May 25th, 10:58 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139