Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
1 registered (Myke), 40 Guests and 14 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 06/05/06
Posts: 708
Top Posters (30 Days)
Ruben 50
DennyP 24
Gizmo 24
Dunny 17
SteveS 14
AllenAyres 12
dbremer 10
SD 9
drkknght00 9
driv 8
Latest Photos
OK Corral Shoot Out
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Topic Options
#165100 - 10/06/06 01:43 PM Complicated SQL query
Yomar Offline
member
Registered: 09/02/04
Posts: 164
Loc: Leiden, The Netherlands
What would be the SQL query for replacing &lt; and &gt; in ubbt_USER_PROFILE > USER_SIGNATURE and ubbt_USER_PROFILE > USER_DEFAULT_SIGNATURE with respectively < and >

?
Top
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
#165101 - 10/06/06 01:54 PM Re: Complicated SQL query [Re: Yomar]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
You'd want to do a database backup on this before hand just in case it causes any problems, but something like this *should* work:

UPDATE ubbt_USER_PROFILE SET USER_SIGNATURE = REPLACE(USER_SIGNATURE, '&lt;','<')

UPDATE ubbt_USER_PROFILE SET USER_DEFAULT_SIGNATURE = REPLACE(USER_DEFAULT_SIGNATURE, 'glt;','>')
Top
#165104 - 10/06/06 02:11 PM Re: Complicated SQL query [Re: Rick]
Yomar Offline
member
Registered: 09/02/04
Posts: 164
Loc: Leiden, The Netherlands
Thank you Rick!

That worked.

I need these to regularly fix the signatures on our forums (their URLs contain a "?php" phrase, as they are dynamic). The sigs are turned into plain text as soon as users try to update their profiles.

I guess I have to store these as two separate SQL Queries right? I can't just paste both lines in the Control Panel's SQL Query window at once, right? As for now I have just entered and executed them one by one.

Unfortunately the &lt;/&gt; are stored as </> as soon as you try to store the queries. I have stored them anyway, so that I can copy/paste and then edit them for future use


Edited by Yomar (10/06/06 02:12 PM)
Top
#165105 - 10/06/06 02:16 PM Re: Complicated SQL query [Re: Yomar]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
Since they are both working on the same table you can try doing them as one query like:

UPDATE ubbt_USER_PROFILE
SET USER_SIGNATURE = REPLACE(USER_SIGNATURE, '&lt;','<'),
USER_DEFAULT_SIGNATURE = REPLACE(USER_DEFAULT_SIGNATURE, 'glt;','>')
Top
#165107 - 10/06/06 03:12 PM Re: Complicated SQL query [Re: Rick]
Yomar Offline
member
Registered: 09/02/04
Posts: 164
Loc: Leiden, The Netherlands
Thank you Rick!

There were a few errors in that, but I got the idea:

UPDATE ubbt_USER_PROFILE SET USER_SIGNATURE = REPLACE(USER_SIGNATURE, '&lt;','<'), USER_DEFAULT_SIGNATURE = REPLACE(USER_DEFAULT_SIGNATURE, '&gt;','>')

Thanks a lot!
Top



Moderator:  AllenAyres, Harold, Ian, Ron M 
Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Ability to "like" individual posts (not Facebook "likes)
by doug
09:03 AM
Island Permissions
by ThreadsUser
05/22/12 03:03 PM
streaming video
by prkrgrp
05/20/12 07:02 PM
New Posts Corrupted? Can someone help?
by PianoWorld
05/19/12 09:41 AM
Custom forum permissions
by ntdoc
05/18/12 02:07 PM
Forum Stats
10489 Members
36 Forums
33840 Topics
181692 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image