Danny159 Posted May 18, 2010 Posted May 18, 2010 Hi, I am trying to add HTML into a mySQL database... The script is saying its gone it but its not in the database, however sometimes it works and sometimes it doesnt work. Anyone have any idea how I can fix this maybe I need some code to tell the mysql its html? Dan
contink Posted May 18, 2010 Posted May 18, 2010 Can you output your table structure and highlight the fieldname you're storing the HTML in... It may simply be the incorrect choice of field type... You'll also be wanting to escape any input to avoid the SQL suffering a syntax error...
soveryapt Posted May 18, 2010 Posted May 18, 2010 What sort of HTML as well would be useful .. i.e. a web address or something more complicated to run, say, a CMS? From memory (and it has been a while) wrapping the field in " " tends to allow it in there better, but as contink said... Can you output your table structure and highlight the fieldname you're storing the HTML in...
SteveBentley Posted May 19, 2010 Posted May 19, 2010 Certainly worth running the input through addslashes() and use stripslashes() when you retrieve it to escape characters that could cause you grief. 1
Danny159 Posted May 19, 2010 Author Posted May 19, 2010 This worked thanks for you help again guys Dan
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now