Hello.
let's say i want to add a row to a table called "todaypics" with this 3 columns:
| picnum | imagename | todayhits |
and i do this:
the data is insertedPHP Code:mysql_query("INSERT INTO todaypics (picnum, imagename, todayhits) VALUES('72', 'somepicturename.jpg', '35') ")
or die(mysql_error());
| 72 | somepicturename.jpg | 35 |
witn no problem.
but if the row was already on the
tablewith this data:...
| 72 | somepicturename.jpg | 34 |
...how sohuld be the query to avoid the duplicate error and update the column "todayhits" value to 35??


Reply With Quote

Bookmarks