|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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).] |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Database insertion question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|