Ashwin,
Wednesday, July 24, 2002, 3:15:25 PM, you wrote:
AK> I have a table with a field full of urls.. what I need to do is to append
AK> to those urls with a new url, so for example, if the field had
AK> http://www.yahoo.com i want to make it
AK> http://www.myserver.com/login?url=http://www.yahoo.com ..
AK> I have tried the following which I thought should work:-
AK> update table set field = concat("http://www.myserver.com/login?url=",
AK> field) where restriction="D" and location="local";
AK> It goes all fine, however when I do a search I have records that now show
AK> the url as http://www.myserver.com/login?url=http: and it chops off the
AK> rest.. I have checked the size of the field itself and it was a
AK> varchar(255).. I thought maybe it was the restriction, which it was for
AK> about 51 of them cause they showed up as warnings when I ran the update
AK> command, so I changed the varchar to a blob to see the difference and no
AK> longer are there any warnings, but it still chops off everything after
AK> http:
Do you update from mysql command-line client?
I would work ...
mysql> insert into chartest values
-> ('http://www.yahoo.com'),
-> ('http://www.mysql.com'),
-> ('http://www.php.net');
Query OK, 3 rows affected (0.01 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> update chartest set
-> name=concat("http://www.myserver.com/login?url=",name);
Query OK, 3 rows affected (0.01 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> select * from chartest;
+--------------------------------------------------------+
| name |
+--------------------------------------------------------+
| http://www.myserver.com/login?url=http://www.yahoo.com |
| http://www.myserver.com/login?url=http://www.mysql.com |
| http://www.myserver.com/login?url=http://www.php.net |
+--------------------------------------------------------+
3 rows in set (0.00 sec)
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Victoria Reznichenko
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php