Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 25th, 2005, 03:23 PM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default inserting into oracle using php

When I try to insert a string that contains an apostrophe or single quote into my oracle database from a php script, it gives me an error. So I tried searching the string for any single quotes and using ereg_replace("'","''",$str);, to replace any single quotes with two single quotes. It was able to insert, but, instead of inserting a single quote, it inserted a backslash (\), before the single quote. (\')

Any ideas of how to insert an apostrophe or single quote into an oracle database using php?

Reply With Quote
  #2 (permalink)  
Old May 26th, 2005, 03:01 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Ues addslashes($data) before inserting data to db. After retrieval from db use stripslahes($data), before displaying data.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting records to Oracle db from asp page jowjow Classic ASP Basics 0 April 4th, 2006 09:24 AM
inserting records in oracle from asp page jowjow Oracle ASP 0 April 4th, 2006 09:17 AM
Problem in inserting 100KB string into oracle db MSUser Oracle 1 December 31st, 2004 05:55 AM
problem in inserting blob data to oracle selphyr JSP Basics 2 December 2nd, 2004 01:44 PM
Bulk Inserting from VB to Oracle parshavgarg Pro VB Databases 0 July 29th, 2004 07:18 AM



All times are GMT -4. The time now is 04:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.