Find and Replace Text in MySQL Database

How to Find and Replace Text in MySQL Database using SQL query.

Find and Replace Text in MySQL Database

REPLACE is a function that returns the string text_string with all occurrences of the string from_string replaced by the string to_string, where matching is case-sensitive when searching for from_string.

text_string can be retrieved from the a field in the database table too. Most SQL command can be REPLACE() function, especially SELECT and UPDATE manipulation statement.

Example:

update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’);

update customer_table set company_name = replace(company_name, ‘The Wolf of Wall Street”, ‘The Tiger of Wall Street’);

This MySql query/statement will replace all instances of ‘The Wolf of Wall Street’ to ‘The Tiger of Wall Street’ in the field of company_name of customer_table table.

 

 

One more small and useful query.

Rename or change name of MySQL table.

To rename an existing MySQL table, with or without data in it, it is no problem. One simple command will change the table’s name:

RENAME TABLE mike TO ann;

you can find more here too: mydigitallife.info

Heartbleed Security Update

Originally posted on WordPress.com News:

Last week, a very serious bug in OpenSSL was disclosed.  OpenSSL, a set of open source tools to handle secure communication, is used by most Internet websites.  This bug, nicknamed Heartbleed, allowed an attacker to read sensitive information from vulnerable servers and possibly steal things like passwords, cookies, and encryption keys.

Was WordPress.com vulnerable to Heartbleed?

Yes. WordPress.com servers were running the latest version of OpenSSL, which was vulnerable. We generally run the latest version of OpenSSL to enable performance enhancements, such as SPDY, for our users. The non-vulnerable versions of OpenSSL were over two years old.

Has WordPress.com fixed the issue?

Yes. We patched all of our servers within a few hours of the public disclosure.

Has WordPress.com replaced all SSL certificates and private keys?

Yes. Out of an abundance of caution, we have replaced all of our SSL certificates, along with regenerating all of the associated…

View original 98 more words

How to Avoid Answering the Questions? 9 ТЕХНИК УХОДА ОТ ПРЯМОГО ВОПРОСА

How to Avoid Answering Questions You Cannot Answer

How to Avoid Answering Questions You Cannot Answer

1. Ask the person who asked you the question another question. They’ll respond to your question and hopefully forget about their own.

2.  Take your cell phone out and pretend you got a call. Try to become so involved with it, they’ll forget about the question, or get bored and decide to find somebody else to talk to.

3. Be honest. Simply say, “I’m not sure how to answer that.” If it’s somebody that really cares about you, they will drop the question.

 

9 ТЕХНИК УХОДА ОТ ПРЯМОГО ВОПРОСА

1. Можно задать встречный аналогичный вопрос или вопрос из совершенно другой области. Пусть вас посчитают плохо воспитанным – душевный комфорт дороже. Знаменитости и политики именно так поступают с навязчивыми вопросами репортеров.

2. Если вопрос не достаточно корректно поставлен, его можно оставить без ответа. Сделайте вид, что не расслышали или не поняли, о чем идет речь. Парируйте вопрос шуткой, юмор всегда уместен.

3. Если природа одарила вас даром красноречия, лейте воду. Чем больше слов, ни к чему вас не обязывающих, тем лучше. Отвечайте на прямой вопрос так, чтобы запутать собеседника. «Отзеркальте» вопрос, мысленно поставив собеседника на место.

4. На один вопрос задайте массу уточняющих вопросов. Делайте это с искренним выражением лица, чтобы убедить человека в заинтересованности. Это обескуражит оппонента.

5. Выясните, почему собеседник задает этот вопрос. Какую цель он преследует? Цели бывают благородными и низкими. Таким образом вы полностью переключите внимание на своего оппонента.

6. Если не хотите отвечать на прямой вопрос или не знаете ответ, польстите собеседнику, похвалив его за находчивость и ум. Между тем незаметно переведите разговор в другое русло.

7. Предложите обсудить постановку данного вопроса, переформулировав его и плавно переведя разговор из допроса в диспут.

8. Проигнорируйте неудобный вопрос или ответьте: «Не знаю, я не задумывался над этим». Нагло заявите собеседнику, что вам это не интересно и «Вместо этого поговорим о тебе».

9. Грубо оборвите собеседника, дав ему понять, что он переходит дозволенные границы приличия. В крайнем случае, можно повысить тон и пойти на конфликт – цель оправдывает средства.

Easy htaccess tricks

htaccess tricks .htaccess (hypertext access) file is a directory-level configuration file supported by several web servers, that allows for decentralized management of web server configuration. They are placed inside the web tree, and are able to override a subset of the server’s global configuration for the directory that they are in, and all sub-directories.

The original purpose of .htaccess—reflected in its name—was to allow per-directory access control, by for example requiring a password to access the content. Nowadays however, the .htaccess files can override many other configuration settings including content type and character set, CGI handlers, etc.

Redirect whole site except one directory – 301 Redirect for all pages to new site Except 1 directory


RewriteEngine on
RewriteCond %{REQUEST_URI} !^/keepthis-directory/
RewriteRule (.*) http://www.youneeditall.com/$1 [R=301,L]

If you get 500 Internal Error then double-check that you have a space between } and ! on the second line.you can even to sub and sub-sub directory

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/keepthis-directory/andthis
RewriteRule (.*) http://www.youneeditall.com/$1 [R=301,L]


keepthis-directory - replace with name of your directory you would like to keep live without redirecting
andthis - name of sub-directory that also important to keep


Permanent – 301 and temporary redirect.

THIS WILL Permanently REDIRECT ONLY HOME PAGE to NEW site:
RedirectMatch 301 ^/$ http://www.youneeditall.com/

Below rules Will redirect All pages to new site
<IfModule mod_rewrite.c>
##RewriteEngine On
## RewriteCond %{HTTP_HOST} ^domainbuyitnow.com/$ [OR]
## RewriteCond %{HTTP_HOST} ^www.domainbuyitnow.com/$
##RewriteRule (.*)$ http://www.youneeditall.com/$1 [R=301,L]
<!–IfModule>

This allows you to redirect your entire website to any other domain

Redirect 301 / http://www.youneeditall.com/

Speedup your site rules

Compress output using GZIP

Add following snippet into your htaccess file and compress all the css, js, html files with GZip compression.

<IfModule mod_gzip.c>
    mod_gzip_on       Yes
    mod_gzip_dechunk  Yes
    mod_gzip_item_include file      \.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler   ^cgi-script$
    mod_gzip_item_include mime      ^text/.*
    mod_gzip_item_include mime      ^application/x-javascript.*
    mod_gzip_item_exclude mime      ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
code works only if mod_gzip module is enabled in your web-server.
ExpiresActive On
ExpiresByType image/jpg “access plus 1 year”
ExpiresByType image/jpeg “access plus 1 year”
ExpiresByType image/gif “access plus 1 year”
ExpiresByType image/png “access plus 1 year”
ExpiresByType text/css “access plus 1 month”
ExpiresByType application/pdf “access plus 1 month”
ExpiresByType text/x-javascript “access plus 1 month”
ExpiresByType application/x-shockwave-flash “access plus 1 month”
ExpiresByType image/x-icon “access plus 1 year”
ExpiresDefault “access plus 1 days”# Cache Headers
<ifmodule mod_headers.c>
# Cache specified files for 31 days
<filesmatch “\.(ico|flv|jpg|jpeg|png|gif|css|swf)$”>
Header set Cache-Control “max-age=2678400, public”
<!–filesmatch>
# Cache HTML files for a couple hours
<filesmatch “\.(html|htm)$”>
Header set Cache-Control “max-age=7200, private, must-revalidate”
<!–filesmatch>
# Cache PDFs for a day
<filesmatch “\.(<span=”” class=”hiddenSpellError” pre=””>pdf)$”>
Header set Cache-Control “max-age=86400, public”
</filesmatch>
# Cache Javascripts for 31 days
<filesmatch “\.(js)$”>
Header set Cache-Control “max-age=2678400, private”
</filesmatch>
</ifmodule>

You may want to add following snippet if your webserver provides mod_deflate support.
<Location>
    SetOutputFilter DEFLATE
      SetEnvIfNoCase Request_URI  \
        \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI  \
        \.(?:exe|t?gz|zip|gz2|sit|rar)$ no-gzip dont-vary
</Location>
more to come later
check this out:

Google Custom Search Engine

 Google Site Search options.

Custom Search Engine (free) and Google Site Search (from $100/year).

What is  difference between  Search Engine for Site and Google Site Search?

Before I got answer from Google support I find it on the developers area.

Custom Search Engine comes in two flavors: Custom Search Engine (free) and Google Site Search (from $100/year).

Google Site Search lets you create search engines that do not include ads, remove Google branding (if you so choose). In addition, Google Site Search customers can retrieve results in XML, so that you have more control over how the results are presented to your users.

For Google Site Search customers only:

If you have a Google Site Search license, you can use the Google WebSearch service to retrieve and display Google search results on your own websites. The WebSearch service uses a simple HTTP-based protocol to serve search results. Google then returns search results in XML format.

View the XML reference guide.

More to come later…

 

For SEO Tips and Tricks From Nikolay Gul – Web Designer and Web Developer in Syracuse: http://www.youneeditall.com/search-engine-marketing/seo-tips.html

Bad Clients are Easy to Find

Bad Clients are Easy to Find

by Mary-Lynn Bellamy-Willms

Most creative companies have worked with clients that have morphed into something nasty. How does it happen? Are there clues that the client will be a disaster? Are there clues a client will be a dream? The short answer to both questions is yes. There are definitely clues and if you know what you’re looking for, you can see the signs almost from the first contact.

Here’s a four-point checklist that can help you spot the bad client before you get stuck with them. If you say ‘yes’ to these, you’re in for trouble:

Will this be a bad client? The Four-Point Checklist

  1. The client’s brief is unclear and unfocused. Yes____ No____
  2. The client claims they don’t know what their budget is, but for some reason, they think you can define one. Yes____ No____
  3. The client asks for free strategy, free creative and cost estimates before they agree to pay you for any of it. Yes____ No____
  4. The client’s timeline is ridiculous. Yes____ No____

What if you have a new client and your ‘spidey senses’ are telling you something is just not right. Here are the clues that things will eventually end poorly. And by poorly, I mean that you won’t get paid for all of the time you’ve spent and in fact, you may even get left empty-handed.

Here are the clues that this relationship will eventually go sour:

  • the client’s briefs are unclear and unfocused;
  • they can’t tell you what the budget is, but when you give them the estimate, they don’t have the funds to do what they’ve asked for. Of course they still want and expect it all;
  • when you present your thinking and your concept work, they don’t comment on those things but instead focus on the size of the logo, a colour they don’t like or some other minor component, but they don’t really speak to the idea;
  • they ask for a combo of ‘idea 1′ and ‘idea 2′, regardless of whether they fit together or not;
  • they often let you know that their son/daughter/friend/spouse doesn’t like something about your work – it’s never about strategy and it’s always subjective;
  • they are in a hurry to receive your work, but don’t meet the timeline for their parts of the process… ever… and yet they still want the work delivered for the original date;
  • they never, ever say ‘thank you';
  • they complain a lot;
  • they grumble about the bill, might try to get you to ‘knock something off’, pay slowly (often because the invoice sits on their desk and doesn’t get passed on to accounting); and,
  • getting them to share results is like wrestling a bone from a hungry dog. Practically impossible.

So… enough about the bad client behavior. What are the signs that your relationship will succeed?

Here’s how to spot a great client. Look for clients who:

  • provide you with thoughtful, clear direction;
  • provide you with a realistic budget;
  • provide you with a reasonable timeline;
  • agree to evaluation criteria before you begin work;
  • provide thoughtful feedback to you on your internal brief;
  • want to engage in a dialogue about your strategy and your thinking BEFORE they see any creative;
  • use the evaluation criteria to evaluate the work;
  • provide clear and helpful feedback;
  • meet their end of the timelines;
  • say ‘thank you’ and acknowledge the efforts of the team;
  • provide ongoing feedback on results;
  • keep a record of the results and feedback so you can improve and do an even better job on the next project together.

Clearly, no one wants bad clients. They end up taking your precious time and energy (and face it, they seem to drain the tank), and almost without fail, they never pay you fairly for the work. They simply don’t value what you do.

When it comes right down to it, the difference between a good client and a bad one is respect. And that goes both ways. A good relationship is always rooted in respect for one another’s contributions to achieving a goal, and recognition that you are all on the same team and are working together for the greater good.

Inevitably, a good client is worth their weight in gold. Literally. They respect you, pay for the work, and provide good and constructive feedback. So go forth and seek out the good ones and say good-bye to the bad ones. You’ll be happier, richer, more fulfilled, and your work will actually be better, too.

This article has been written by FunctionFox CEO and owner of Suburbia Advertising, Mary-Lynn Bellamy-Willms. For more articles and resources, see http://www.functionfox.com/articles/.