MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 27th, 2000, 01:24 AM
rpgswap.com rpgswap.com is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 51 rpgswap.com User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
I have a form (like this one im typing in now) that lets users submit info into the database. I want it to let them submit apostrophes and other characters that mysql converts, or php converts before putting them in the database. It makes it print out like /'. How can i make it just accept and apostrophe, and print it out normally.

Thanks

Sam

Reply With Quote
  #2  
Old August 27th, 2000, 10:08 PM
bean_bag bean_bag is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 1 bean_bag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sam,
If you are using PHP to insert into the MySQL db, you can use the addslashes() function.

Here is a simple example : (the submitted form fields here are "task" and "project")

$esc_task = addslashes($task);
$esc_project = addslashes($project);
$sql = "INSERT INTO archives (taskname,projectname) VALUES ('$esc_task','$esc_project')";
$result = mysql_query($sql);

bean_bag


[This message has been edited by bean_bag (edited August 27, 2000).]

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Database insertion question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT