' (apostrophe) in SQL challenges...
' (apostrophe) in SQL challenges...
I am having trouble with text that contains ' in some SQL. Example, O'Brians, Macy's etc. Entering 2 x ' in each place where you normally put in 1 ' solves the problem but I don't want to do that. Has anyone successfully tackled this issue? Thanks much for your advice.
Re: ' (apostrophe) in SQL challenges...
str_replace() which is a php function helped me solve my problem. All good.
Re: ' (apostrophe) in SQL challenges...
Hi
I'm having this issue on new version. Apologies in advance if this question is a bit dunce-like!
- the field that I am trying to save is $data['address1']
- the table is address
- I understand the answer is to either strreplace("'",'', $data['address1']) OR $data['address1'] = addslashes($data['address1']), right?
Is this correct? Where do I add the line?
TIA, JAmes
I'm having this issue on new version. Apologies in advance if this question is a bit dunce-like!
- the field that I am trying to save is $data['address1']
- the table is address
- I understand the answer is to either strreplace("'",'', $data['address1']) OR $data['address1'] = addslashes($data['address1']), right?
Is this correct? Where do I add the line?
TIA, JAmes
Re: ' (apostrophe) in SQL challenges...
Mmh, ignore that :/