Peter,
Something like this in PHP:

$sql = 'UPDATE table_name SET column_to_update = CONCAT(SUBSTR(column_to_update,1,133),'.mysql_escape_string($text_to_insert).',SUBSTR(column_to_update,134))';

Richard Safran

Peter Sawczynec wrote:
I want to write an update query for MySQL 5.x that will update an entire table. The query will have to insert a text term tag (such as [<TAG>] ) into a field.

The field column to be updated will be a text type and likely contain several hundred words comprised of sentences and paragraphs.

The text term needs to be inserted after the 133 word or at the end of the textual content if shorter.

Can SQL do this on its own?

If you happen to have an example laying around because you did something just like this once, thanks, gracias, merci, dank, grazi.

Warmest regards,

Peter Sawczynec

Technology Dir.

blūstudio

941.893.0396

[email protected] <mailto:[email protected]>

www.blu-studio.com


------------------------------------------------------------------------

_______________________________________________
New York PHP Community MySQL SIG
http://lists.nyphp.org/mailman/listinfo/mysql

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php
_______________________________________________
New York PHP Community MySQL SIG
http://lists.nyphp.org/mailman/listinfo/mysql

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to