Forum Moderators: open

Message Too Old, No Replies

Duplicate MySQL rows with id and visit number

Take username, copy it twice and add number

         

s9901470

10:36 am on Apr 7, 2006 (gmt 0)

10+ Year Member



Hi

I have questionnaire data stored in MySQL according to the username and 'visit number' of the visitor. At the moment I have one visit per visitor ('username','1st') but I would like to add two visits. So each visitor will have three rows in the table:

'username','1st'
'username','2nd'
'username','3rd'

Could anyone recommend a snippet of code that will take username,1st and copy the username within the same table, adding visit 2 and visit 3? One the visitors have three rows, I can invite them to return.

Many thanks

volatilegx

2:03 pm on Apr 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just playing devil's advocate here: why not just have one row and increment the 'visit' value... start at '1', on second visit increment it to '2', and on third visit increment it to '3'?

s9901470

7:58 am on Apr 10, 2006 (gmt 0)

10+ Year Member



I need a row for each visit because the data might be different for each colum.