Re: solved [message #186096 is a reply to message #186092] |
Fri, 13 June 2014 19:44 |
Mr Oldies
Messages: 241 Registered: October 2013
Karma:
|
Senior Member |
|
|
On Fri, 13 Jun 2014 15:01:53 -0400, Jerry Stuckle wrote:
> On 6/13/2014 2:43 PM, richard wrote:
>> On Fri, 13 Jun 2014 10:14:06 -0400, Jerry Stuckle wrote:
>>
>>> On 6/13/2014 9:57 AM, richard wrote:
>>>> On Fri, 13 Jun 2014 00:57:10 -0400, richard wrote:
>>>>
>>>> > When attempting to transfer records from one table to another, certain
>>>> > records refuse to be.
>>>> > Such as those with words like "I'm".
>>>> > What's even more confusing is, "It's" won't work, but "Cathy's" is ok?
>>>> >
>>>> > I know there is a procedure in PHP for dealing with this.
>>>> > I just can't find it right now.
>>>> > Can anyone help on this?
>>>>
>>>> $a=str_replace("'","\'",$a);
>>>> Works just fine.
>>>> Thanks for the reminder tim.
>>>>
>>>
>>> That might work for sqllite, but it's definitely the WRONG way to do it
>>> in MySQL.
>>
>> As you continously remind me, this is not an mysql issue.
>> The table data could care less what characters are in it.
>> mysqli doesn't give a shit either.
>>
>> if I code the data with a \ in the column cell, the output will show that
>> \.
>>
>
> One again you are WRONG! As evidenced by the failure of the insertions.
>
> And if you would have checked for errors (as you've been told many times
> before), you would have found a MySQL error.
>
> I remind you if something is not a MySQL issue when it's not a MySQL
> issue. However, you can't learn the difference between PHP and MySQL.
>
> Here's a hint: PHP doesn't care what's in a string. So if neither one
> cares, why should the INSERT fail?
Jerry, you are argumentative here just to be arguing.
I did put in an error check.
That confirmed that it was the single quotes causing the problem.
What's going to happen when you say:
insert into tabe VALUES('it's').
PHP, not mysqli, kicks back an error right?
PHP sees the third single quote as a mismatch.
To correct this, you must include a \.
Insert into table VALUES('it\'s') is now acceptable.
|
|
|