Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

& Ampersand in MYSQL CANCAT()

Posted on 2009-07-15
4
Medium Priority
?
966 Views
Last Modified: 2012-08-14
How do you escape a & ampersand in mySQL, I have something like the following but need to have a ampersand in the CONCAT(), I have tried escaping \ but that does not work.

SELECT modules.URLvalue, modules.filepath, modules.id, CONCAT( modules.URLvalue,'\&pgid',modules.id) AS link
0
Comment
Question by:dstubblefield65
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 43

Expert Comment

by:pcelba
ID: 24863436
If it is URL I would try %26 instead of &. (I am too lazy to test it, MySql is not installed here, sorry.)
0
 

Author Comment

by:dstubblefield65
ID: 24863814
I tried the %26, also the & an neither worked, all i get with the %26 is %26
0
 
LVL 43

Accepted Solution

by:
pcelba earned 1000 total points
ID: 24864263
What about CHAR() function?

SELECT modules.URLvalue, modules.filepath, modules.id, CONCAT( modules.URLvalue, CHAR(38), 'pgid', modules.id) AS link
0
 

Author Comment

by:dstubblefield65
ID: 24864543
That did the trick, hadn't thought of the ASCII character sets
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

660 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