Solved

MySQL Query Help

Posted on 2012-04-04
2
348 Views
Last Modified: 2012-04-04
Ok,

So I have a table, with field 'short' that contains shortened version of urls.
Right now row['short'] on each row would outuput links like this:
on.fb.me/zzV01q

But I want it to output:
bit.ly/zzV01q

So I tried this:
update videos2 set short = replace(short, ‘on.fb.me’, ‘bit.ly’) WHERE length('short') > 0

Open in new window


But It gives me error:
#1054 - Unknown column '‘on.fb.me' in 'field list'

short is a varchar(30)       utf8_general_ci        by structure.
0
Comment
Question by:GVNPublic123
2 Comments
 
LVL 21

Accepted Solution

by:
oleggold earned 500 total points
ID: 37808297
try
 update videos2 set short = replace(short, "on.fb.me", "bit.ly") WHERE length('short') > 0
0
 

Author Comment

by:GVNPublic123
ID: 37808318
That worked. Stupid semicolons.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now