FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » how to change character to % character?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: how to change character to % character? [message #183353 is a reply to message #183334] Mon, 21 October 2013 01:02 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 10/20/2013 2:50 PM, richard wrote:
> On Sun, 20 Oct 2013 20:04:54 +0200, Luuk wrote:
>
>> On 20-10-2013 18:27, richard wrote:
>>> I noticed that whenever a song is clicked on that has an apostrophe in the
>>> name, an error is now being generated.
>>> The song still plays and the name is reported correctly.
>>>
>>> So how can I detect any and all 's within a string and convert them to the
>>> %27 version?
>>>
>>> I had a look at preg-match and don't think that will help.
>>>
>>> www.mroldies.net/200/
>>>
>>>
>>
>>
>> Why do i see this error:
>> You have an error in your SQL syntax; check the manual that corresponds
>> to your MySQL server version for the right syntax to use near 's Now Or
>> Never ',' It's Now Or Never ',1) ON DUPLICATE KEY UPDATE hits=hits+1' at
>> line 1
>>
>> on this link:
>> http://www.mroldies.net/200/audiox1.php?play=6
>>
>> Can you not see that this is not a proper MySQL statement?
>>
>> Nut you better fix this now than never.......
>
> Precisely why I am asking how to fix.
> The error stems from the fact that the echo statement "sees" a single quote
> as part of the structure of the statement itself. NOT as a string.
> IOW, "Hey stupid....your quotes don't match!"
>
> It is not a MYSQL problem. it is purely a syntax matter.
>

As you have been told MANY, MANY times before. You need to escape ALL
of the strings you use when accessing ANY SQL database (not just MySQL).



--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Load Data from XML url
Next Topic: Re: Help with app Crash
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 05 16:18:39 GMT 2024

Total time taken to generate the page: 0.06904 seconds