I have a delete function working right up until the field value has a character like a #. Then the record won't be deleted.
The field is defined as char(50).
'DELETE FROM ' $ g.Store_Table_Prefix $ 'tblname WHERE strdata = ?'
test 1 is deleted
test #1 is not deleted
And, it makes sense that I can't find the record and pull into my form to do an update.
I actually don't care either way to use or invalidate special character. But, using isalnum() doesn't like spaces either. I don't think that would be a problem either. But, seems like I should just fix the query instead.
Do I need to escape those characters for this to work? If so, is there a way to automatically escape chars I don't know is being used in the query?
Or, is there something I am missing?
BTW: I am not current using any indexing in this table. I was planning on recoding to use a unique index on this field.
Thanks.
Scott
The field is defined as char(50).
'DELETE FROM ' $ g.Store_Table_Prefix $ 'tblname WHERE strdata = ?'
test 1 is deleted
test #1 is not deleted
And, it makes sense that I can't find the record and pull into my form to do an update.
I actually don't care either way to use or invalidate special character. But, using isalnum() doesn't like spaces either. I don't think that would be a problem either. But, seems like I should just fix the query instead.
Do I need to escape those characters for this to work? If so, is there a way to automatically escape chars I don't know is being used in the query?
Or, is there something I am missing?
BTW: I am not current using any indexing in this table. I was planning on recoding to use a unique index on this field.
Thanks.
Scott
Comment