I have fields with numbers. I want to update the field and add commas and a text behind the number. Example 1000 would become 10,000 MyText 10000 would become 10,000 MyText Would it be possible?
Is the text the same for all numbers ? If it was, you could do a database backup, then a simple find/replace find 000 replace with ,000 MyText Then restore your database
hmmm i Do Not think that the query add the ( ,) to the number but there must be a way to show it when making an output query.
If the field is numeric, then you simply can't. If the database field content is alphanumeric then you can build your sql string within your PHP code which gives you more coding capability than just trying to query it directly with a single mysql update. In an other hand, you will need to query the database twice in order to perform the operation. One for reading, one for updating. Replacing in between the string read with another one can be done using several methods: using regular expression for instance (which I don't like), or simply completing the string with standard and more human readable code using something as simple as: $string = substr($string, 0, strlen($string) - 3) . ",000 MyText";