PHP Questions Home
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I escape data that is going into a database?


There are various ways to do this. If you know for sure that you need to escape your data, one way is through using the addslashes function, like this:
<?php
$mydata 
"hello I'm great"
$mydata addslashes($mydata);
//now contains: hello I\'m great
?>



ASK A QUESTION

More forms PHP Questions

How can I access information sent through POST on a form?

PHP program to register students' record

How do I remove HTML tags from a string?

how to i decimal, comma, and $ format a number called from mysql displayed in a table cell using php. This is the call script and this is the formatting script How do I replace the $value=123... with my call script? Thanks

How do you check for an empty field in a form?



Custom Search