I have a client who wants to periodically swap out javascript code on various pages of his website (i.e. to pull up ads from various affiliates such as Google AdSense and others). We would like to do this using a database, but do not know if this is possible. We have always added javascript code to the php/html file itself (using the {literal} tags for phpr templates when necessary) rather than into the database.
In my experience, inserting any javascript code into the My SQL database using phpr has caused whatever database record the script is in to cease functioning - i.e. it will no longer pull up when called for. If the javascript is removed (via phpmyadmin), the record works fine again.
Is there a way to add javascript code into a database record to prevent this from happening? I have tried searching the internet for an answer, but have not found one.
Thank you for any assistance.
Janet