|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
RE: This is probable really easy
Try "Need some data in the database's".
|
|
#3
|
|||
|
|||
|
RE: This is probable really easy
you need to addslashes() the string before inserting it into the db
|
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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...
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > This is probable really easy |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|