Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase 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 Codewalkers Forums Sponsor:
  #1  
Old December 10th, 2003, 01:45 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
This is probable really easy

Hello,

I have an open form field that works perfectly when inserting into a mysql database untill you through in a tick, like this

Need some data in the database's

the ' stops the insert.

any ideas's

Thanks

Reply With Quote
  #2  
Old December 10th, 2003, 01:52 PM
Seadoo Seadoo is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 133 Seadoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: This is probable really easy

Try "Need some data in the database's".

Reply With Quote
  #3  
Old December 10th, 2003, 02:23 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: This is probable really easy

you need to addslashes() the string before inserting it into the db

Reply With Quote
  #4  
Old December 10th, 2003, 02:38 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: This is probable really easy

O.k. I have a form just like the one I am writing in now. When a user enters something like this
From the form
$messagepost would be

Hello World I want to insert some data in to a database, it doesn't work.

because of the tick mark in doesn't

Here is my insert statement

[highlight=php]
// insert the message into the promo table
$insert_promo = mysql_query("INSERT INTO promo (company_num, promo_subject, promo_message,promo_date,subscriber_cnt)
VALUES ('$get_vendor_cnt','$name','$message_post','$daten ow',$i)", $linkID);
[highlight=php]

If the end user uses a ' mark it stops the insert process


Reply With Quote
  #5  
Old December 10th, 2003, 02:45 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: This is probable really easy

Got it
Here is what I did...
$message_post = addslashes($message_post);


Left the insert the same worked like a charm.

Thanks for the help.





Reply With Quote
  #6  
Old December 10th, 2003, 02:53 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: This is probable really easy

just remember that you will want to use stripslashes() on the output if you want to display the string without the added slashes...

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > This is probable really easy


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 5 hosted by Hostway
Stay green...Green IT