user1768076
user1768076

Reputation: 399

MySql concat and quotes

I am trying to do something like this:

<td>style="background:url('myimage.jpg') no-repeat;"> + column + </td>

But I get a MySQL error when trying:

Concat ('<td>style="background:url('myimage.jpg') no-repeat;">', info_text, '</td') as Nicetext

I suppose it is all the quotes that mess things up.

Thanks for all help!

Upvotes: 4

Views: 13129

Answers (2)

SteveP
SteveP

Reputation: 19103

Your strings include quote marks. You will have to escape them. Try something like:

Concat ('<td>style="background:url(\'myimage.jpg\') no-repeat;">', info_text, '</td') as Nicetext

Upvotes: 7

Mohamed Amine
Mohamed Amine

Reputation: 2304

You haven't escaped the quotes. Try this :

Concat ('<td>style="background:url(\'myimage.jpg\') no-repeat;">', info_text, '</td') as Nicetext

Upvotes: 1

Related Questions