Re: Novice MySQL problem

From: Date: Mon, 14 Nov 2011 11:44:05 +0000
Subject: Re: Novice MySQL problem
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-315672@lists.php.net to get a copy of this message
Jim Giner wrote: > > "drive view" <driveview@gmail.com> wrote in message > > news:CAM4sN2iP7yncW2-2sOq-Vjk8Suer7U5X96fvPEQoiTkkCaJraQ@mail.gmail.com... >> Hi, >> >> I'm a novice to MySQL and am currently facing the following difficulty. >> I'm trying to update a table with a row of data the primary key of which >> is >> an ID which I believe is an auto incrementing serial number. My first >> question is how to check if this is the case. >> > > If you are updating a row, you should already know the id of the record, > so > in your update statement you reference it in the where clause. (ie, > "where rec_id = $curr_rec_key") > >> Secondly while trying to insert such a row leaving out this column mySql >> is >> inserting the row at ID 0 (the previous ID's in the table are from 1 to >> 9), >> but then will not take further inserts. >> >> Thanks for any help available. >> >> >> Regards >> >> Toni >> > > I don't know what the problem here is. Personally I never use auto-inc > fields. That statement tells us you have a poor understanding of the concept of relational databases, or you don't use relational tables. Cheers -- David Robley Sure, it's clean laundry. The cat's sitting on it, isn't he? Today is Pungenday, the 26th day of The Aftermath in the YOLD 3177.

« previous php.general (#315672) next »