How To Put Data In A Database
Computing : Learning PHP One of the great things about PHP is it's so easy to connect and interface with a database, for instance mySQL typically for smaller sites. However, one big problem can come with putting data in the database. The single biggest cause of problems (apart from malicious hack attempts of course) is dealing with quotation marks or single quotes in the entry string, depending how you add the data to the database. This is why you should always ensure that you add slashes to the quotation marks before you put the data in the database, with this simple line: $uploadtodb = addslashes($uploadtodb); You can also strip them when taking data out using stripslashes Also note the setting of magic quotes (on or off) will have an impact on different servers, so it's always best to check if this is on or off and adjust code accordingly for true portability.
![]() Questions about mysql:
|
|