Skip to main content

All Questions

3 votes
1 answer
19k views

mysql_real_escape_string not working for me [duplicate]

When I try to do a mysql_real_escape_string for a login system, it does not record the variable from the form. If I do $username = $_POST['username']; and echo it, it displays, but when I do $...
Francisco F.'s user avatar
0 votes
0 answers
63 views

string replace in PHP is not working [duplicate]

I need to insert (for example: "ABC") to my wamp db. I'm using str_replace method for this. Code is as shown below: $currAddr=str_replace(array("'","\"", """),"'",htmlspecialchars($...
Kirataka's user avatar
  • 482
1 vote
1 answer
2k views

Using mysql_real_escape_string return empty

I use mysql_real_escape_string to escape $this->piVars. ....de/index.php?searchGenre=5 $searchGenre = mysql_real_escape_string($this->piVars[searchGenre]); $result = $GLOBALS['TYPO3_DB']->...
user1878413's user avatar
  • 1,813
0 votes
2 answers
432 views

real_escape_string not cleaning up entered text

I thought the proper way to "sanitize" incoming data from an HTML form before entering it into a mySQL database was to use real_escape_string on it in the PHP script, like this: $newsStoryHeadline = ...
sirab333's user avatar
  • 3,722
0 votes
2 answers
201 views

php real_escape_string(), query not working anymore

I want to be able to add and update certain information. Now it was all working fine untill I found out the script no longer works when there's quotation marks in the text being sent to the database. ...
Boudewijn Smit's user avatar
0 votes
3 answers
236 views

mysql_real_escape_string error

I'm getting Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'username'@'localhost' (using password: NO) Here's my code.. <?php include 'config.php';...
rivitzs's user avatar
  • 499
-1 votes
1 answer
3k views

PHP mysql_real_escape_string or alternative with PDO

I'm trying to migrate a lot of old PHP mysql prodecural function like mysql_query, mysql_real_escape_string etc. into PDO with minimum effort. I don't want to rewrite every old DB function. The reason ...
koubic's user avatar
  • 637
11 votes
6 answers
29k views

PHP mysql_real_escape_string returns empty string

I'm trying to work a bit of security and sanitization into my databases application (for a class). to start off with, i'm trying to use mysql_real_escape_string, but whenever i use it, it always ...
Drake's user avatar
  • 443
0 votes
1 answer
258 views

How can I allow only HTML into my database?

I'm trying to allow the user to input only HTML into a form, and on submit, store it into the database. I've been trying to use mysql_real_escape_string, but the PHP I put into the form with the HTML ...
Dennis's user avatar
  • 11
1 vote
2 answers
2k views

apostrophe in mysql/php

i'm trying to learn php/mysql. inserting data into mysql works fine but inserting those with apostrophe is generating an error. i tried using mysql_real_escape_string, yet this doesn't work. would ...
input's user avatar
  • 7,529