Re: never seen this before..
| From: | Jas | Date: | Mon, 24 Jun 2002 17:05:11 +0000 |
| Subject: | Re: never seen this before.. | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20050@lists.php.net to get a copy of this message | ||
Here is the db table structure...
CREATE TABLE demo_sessions (
id varchar(255) NOT NULL auto_increment,
ipaddy varchar(255) NOT NULL,
date varchar(255) NOT NULL,
PRIMARY KEY (id)
);
Let me know if this is correct, I have a feeling that the varchar is my
problem but I could be wrong.
TIA
Jas
<user@domain.invalid> wrote in message
news:3D175042.5040608@domain.invalid...
> TIA --
>
>
> column in your table denotes your primary key? After that, how is it
> incremented? Is it auto or do you have some other form of it. I think
> your code is correct so the error seems to be how the data ID is
generated.
>
> gl -- Seth
>
> Jas wrote:
>
> > I am getting an error when inserting data into a mysql database table.
It
> > is telling me that there is a duplicate entry in the database everytime
it
> > gets 10 records inserted to the table, if I flush the table and try it
again
> > it works fine. Is there some kind of limit on some tables? Here is the
> > error php outputs once the table gets 10 records: Duplicate entry '10'
for
> > key 1
> > Here is the code...
> > require '/home/web/b/bignickel.net/scripts/admin/db.php';
> > $table = "demo_sessions";
> > $sql_insert = "INSERT INTO $table (ipaddy,date) VALUES
> > ('$ipaddy','$date')" or die('Could not insert client
> > info');
> > $result = @mysql_query($sql_insert,$dbh) or die(MYSQL_ERROR());
> >
> > Any help on this would be great
> > TIA
> > Jas
> >
> >
> >
>