|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I have been having the toughest times getting apostrophes to pass into the database. I hvae tried using str_replace("'","`");
i've tried addslashes($foo); , i've tried ereg_replace, and urlencode. Nothing seems to work with an access database. Is there an addslashes(); command specific to ms access databases? I'm using PHP + ODBC with an MS Access database. It was giving errors of missing operators, but now it will pass a \' or a \` but I can't do anything with that record at that point, its almost as if it gets tainted somehow. I can paste code or whatever is needed. Any help is so much appreciated. Last edited by replicant : December 9th, 2002 at 01:36 PM. |
|
#2
|
||||
|
||||
|
For access, you may need to escape a single quote with another single quote, rather than a slash.
---John Holmes... |
|
#3
|
||||
|
||||
|
I would tend to concur with SepodatiCreations. adding slashes is not ANSI sql and will only work in MySQL and PostgresQL. You need to escape each single quote with another single quote.
PHP Code:
|
|
#4
|
|||
|
|||
|
What if i am using Perl+Sybase...
I want to insert a value from a variable into database... But the value contains a ' (single quote) which cannot be inserted into the database... I need to escape it with another '..... Like for eg variable x="O'Brien" which has to be "O''Brien". How can i achieve this in perl????? I have heard of "DBI placeholder"...but how do i achieve that... |
|
#5
|
||||
|
||||
|
Why don't you ask in the Perl forum with a new thread (or search there). I'm sure there is a str_replace() similar function in Perl.
---John Holmes... |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > PHP + Access + getting apostrophes to go |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|