what I am trying todo is make a highscores page and each time it updates I want it to go into the same entry, so if Username is a duplicate I want it to update with the current information and then the information posted, after looking at some stuff on the internet I tried the code below and that gives me the error Column count doesn’t match value count at row 1. Can anyone please tell me what I am doing wrong as I am very new to PHP + MySql.
mysql_query("INSERT INTO $table(Username, Time, Videos, Credits) VALUES ('$user', '$time', '$videos', '$credits',
'ON DUPLICATE KEY UPDATE', Time='Time+$time', Videos='Videos+$videos', Credits='Credits+$credits')", $conn);
The syntax is incorrect, you are passing the ‘on duplicate update’ and it’s rules as values to the insert. The correct query would be