Styles2304 Posted August 12, 2007 Share Posted August 12, 2007 I was trying to update my database with this block of info for my church that requires some javascript however the quotes are throwing me off. Can you tell me how to fix that? Here's the link: <a href="javascript:void(0)" onclick="changePage('randompage.html');" class="announcements">here</a> Link to comment https://forums.phpfreaks.com/topic/64456-storing-javascript-in-a-database/ Share on other sites More sharing options...
gurroa Posted August 12, 2007 Share Posted August 12, 2007 You wish to store this block of data into the database? If so $data = '<a href="..." onclick=" ('som..')">Here</a>'; mysql_query(sprintf("update table set field = '%s' where id = 1", htmlspecialchars($data, ENT_QUOTES) )); Link to comment https://forums.phpfreaks.com/topic/64456-storing-javascript-in-a-database/#findComment-321483 Share on other sites More sharing options...
Styles2304 Posted August 12, 2007 Author Share Posted August 12, 2007 Is there a way to do it outside of a custom PHP form? I'm trying to enter it directly into the database using phpMyAdmin Link to comment https://forums.phpfreaks.com/topic/64456-storing-javascript-in-a-database/#findComment-321564 Share on other sites More sharing options...
fenway Posted August 20, 2007 Share Posted August 20, 2007 Is there a way to do it outside of a custom PHP form? I'm trying to enter it directly into the database using phpMyAdmin No idea if phpmyadmin does automatic quote escaping. Link to comment https://forums.phpfreaks.com/topic/64456-storing-javascript-in-a-database/#findComment-329189 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.