OK, a couple of things: I think the first move can be done pretty easily with an SQL query, but in the first post you say "It should only update but not overwrite if data for that user already exists". To do that I think you'd need to have a key defined that includes userid, or else there won't be anything stopping multiple rows with the same userid (I think - I'm not actually an SQL expert or anything).
For the second one, the generated numbers are a bit of an issue. Normally you'd make the id fields AUTO_INCREMENT in one of the tables, then if you needed the value for another table you'd get the last inserted value (which I could do in php but I don't know how to do in SQL).
I might be able to take a shot at a php script that handles this. Someone else who's better at SQL than I am might be able to do it all with one or more queries. Also, since this doesn't look like it's vbulletin-specific, you could ask at some place like stackoverflow.com.
|