I have two tables in a mysql database: Table Cars and Table Comments. Table cars has columns ID which is auto incremented and name. For each name in table cars I want to have a column in table comments and post the comments from users as they come. How do I insert a new value in an empty column without creating a new row. Basically what happens is say I have this database
X _ _
X _ _
X _ _
Instead of posting
X _ X
X _ _
X _ _
it is inserting the new value at
X _ _
X _ _
X _ _
_ _ X
And then the next one at
X _ _
X _ _
X _ _
_ _ X
_ X _
I have looked at the join
function but that seems to join just two columns and not a row with a column. I've also seen
SELECT @row := @row + 1 as row, t.*
FROM some_table t, (SELECT @row := 0) r
but it is not explained very well. How do I make this work?