Re: Update creating a new record?
| From: | Richard Lynch | Date: | Mon, 05 Aug 2002 23:45:52 +0000 |
| Subject: | Re: Update creating a new record? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111291@lists.php.net to get a copy of this message | ||
>I've noticed that every time I "update" a record, mySQL is actually adding a
>new record (highest number ID, at the end) and deleting the original record.
>I don't understand this. For example, if I edit a phone number in the
>listing for ID=023, the next time I view a complete listing of members I'll
>see that person's link now showing ID=128 (or a similar much higher record
>number, 1 higher than the last highest record number). My PHP code uses
>"upate photographers" to update rather than insert a new record. I can post
>the actual code tonight if needed, but I was hoping that someone might have
>an idea of whether or not this was normal. It DOES pull up the right data
>after I update mySQL, but it's the change in the link that bites me on one
>other page with hard-coded links.
Show us source.
Update should not alter their ID, unless, like, you actually *ASKED* it
to...
UPDATE foo set ID = 128 where ID = 023
would do exactly what you describe...
Try echo-ing out your query before you send it to the database, and see what
you are actually saying to MySQL, as opposed to what you *think* you are
saying to MySQL... :-)
--
Like Music? http://l-i-e.com/artists.htm
I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
major distro). Need to record live events (mixed already) to stereo
CD-quality. Soundcard Recommendations?
Software to handle the recording? Don't need fancy mixer stuff. Zero (0)
post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
audio-to-disk.