I want to know if this syntax is correct before I try anything. I have a field with info in it all ready and I want to add a string to every entree. Is this correct syntax. if not what is. I couldn't find it in the docs.
update table set field = field + 'this is the string';
anyone??
__________________
Please login or register to view this content. Registration is FREE - PHP PhotoGallery
I haven'y used MySQL before but it looks like you are
missing a WHERE clause
You only need a where clause if you want to change one specific entree. I wanted to add a string to every one in the table so a where clause is not needed.
Quote:
UPDATE {tableName} SET <col>=NewColValue WHERE <WHERE CLAUSE>
So, for example:
UPDATE articles SET totalNumb = 5 WHERE ID = 4;
That is just for updating not adding 2 strings together in an update. here is what I found so if anyone else needs it, it will not be hard to find.
update table set field = concat(field,'string',...etc); And if you need a specific entree you can add the where clause.
Thanks guys for trying.
__________________
Please login or register to view this content. Registration is FREE - PHP PhotoGallery