Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2005, 06:15 AM
Authorized User
 
Join Date: Dec 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Single Quotes in MySQL fields

My web application using PHP/MySQL works great as long as I don't (ooops... do not) enter a single-quote character in a field.

Can someone shed some light on what might be happening here?

TIA!

 
Old June 10th, 2005, 06:49 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Use mysql_real_escape_string($data) before dumpting $data to MySQL daemon. Use [/i]stripslashes($data)[i] before you display it.
http://www.mediasworks.com/






Similar Threads
Thread Thread Starter Forum Replies Last Post
Please explain single and double quotes rsgracey BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 4 June 8th, 2006 07:20 PM
displaying single quotes and double quotes ren_123 Classic ASP Databases 2 February 22nd, 2006 02:17 PM
Problem with single quotes ' mnoon Access 7 March 16th, 2005 03:44 PM
Problem with " ' " (single quotes) Varg_88 Classic ASP Databases 2 September 3rd, 2004 08:50 AM
Double Quotes and Single Quotes Problem phungleon Classic ASP Basics 7 May 27th, 2004 01:44 PM





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