Re: [PHP] Update or add?

2006-07-02 Thread Chris
Brian Dunning wrote: I have a table where I want to update each record with today's date as it's hit, or add the record if it's not in there: +--+-++ | id | creation_date | last_hit | +--+-++ I'm trying to do this with a

[PHP] Update or add?

2006-06-30 Thread Brian Dunning
I have a table where I want to update each record with today's date as it's hit, or add the record if it's not in there: +--+-++ | id | creation_date | last_hit | +--+-++ I'm trying to do this with a minimum of hits to the

RE: [PHP] Update or add?

2006-06-30 Thread Jim Moseby
I have a table where I want to update each record with today's date as it's hit, or add the record if it's not in there: +--+-++ | id | creation_date | last_hit | +--+-++ I'm trying to do this with a minimum of

Re: [PHP] Update or add?

2006-06-30 Thread Paul Nowosielski
On Friday 30 June 2006 14:37, Brian Dunning wrote: I have a table where I want to update each record with today's date as it's hit, or add the record if it's not in there: +--+-++ | id | creation_date | last_hit |

Re: [PHP] Update or add?

2006-06-30 Thread Adam Zey
Paul Nowosielski wrote: On Friday 30 June 2006 14:37, Brian Dunning wrote: I have a table where I want to update each record with today's date as it's hit, or add the record if it's not in there: +--+-++ | id | creation_date | last_hit |

Re: [PHP] Update or add?

2006-06-30 Thread Paul Nowosielski
Good advice , Thank you! -- Paul Nowosielski Webmaster On Friday 30 June 2006 15:45, Adam Zey wrote: Paul Nowosielski wrote: On Friday 30 June 2006 14:37, Brian Dunning wrote: I have a table where I want to update each record with today's date as it's hit, or add the record if it's not

Re: [PHP] Update or add?

2006-06-30 Thread Venkat Venkataraju
Hi All, there is not-so-used format of SQL format that is INSERT INTO table SET col1=data1, col2=data2... ON DUPLICATE KEY UPDATE col1=data1, col2=data2...; you have to define a primary or unique key in the table and all will work well. for more info