Linked Questions

3 votes
7 answers
40k views

What is the proper way to concatenate text and a variable in PHP inside a mysql_query? Here is my attempt: page.'$pageID' I want it to output page3. Here is all of the code (simplified to focus on ...
Mark Rummel's user avatar
  • 2,950
8 votes
3 answers
13k views

Should I use mysqli_real_escape_string or should I use prepared statements? I've seen a tutorial now explaining prepared statements but I've seen them do the same thing as mysqli_real_escape_string ...
Ali's user avatar
  • 3,436
8 votes
2 answers
8k views

Possible Duplicate: Best way to prevent SQL Injection in PHP What is the best way to escape strings when making a query? mysql_real_escape_string() seems good but I do not exactly know how to use ...
Oskar Persson's user avatar
2 votes
4 answers
9k views

I am very new to mysqli earlier i am writing queries in mysql but mysqli is more advanced so, i am first time using it. Below is my php code. function clean($str) { $str = @trim($str); ...
Roxx's user avatar
  • 4,036
3 votes
4 answers
6k views

I noticed the function json_encode() automatically puts backslashes on " and ' values. I was originally protecting against SQL injections by using mysqli_real_escape_string($con, $value) before the ...
Oliver Tappin's user avatar
6 votes
2 answers
8k views

I know that mysqli_real_escape_string Function can be used to prevent SQL injections. ( However, mysql_real_escape_string() will not protect you against some injections) My question is when should I ...
Sasa1234's user avatar
  • 948
3 votes
3 answers
14k views

I just saw in my webstats that someone appended a lot of SQL code to one url parameter. The URLs look like this: http://www.example.com/page.php?id=672%3f%20and%28select%201%20from%28select%20count%...
user1204121's user avatar
1 vote
4 answers
2k views

Possible Duplicate: Best way to stop SQL Injection in PHP I have seen some of examples that use something called a PDO to make a query safe from sql-infection, or others that use real_escape, but ...
JD Isaacks's user avatar
  • 57.7k
2 votes
2 answers
5k views

I have wrote a PHP script to handle user login. To prevent SQL Injection attack, I have used 'mysql_real_escape_string' function. Everything works good till today. I have traced code and finding the ...
SuB's user avatar
  • 2,577
-8 votes
3 answers
1k views

I have been bothered for so long by the MySQL injections and was thinking of a way to eliminate this problem all together. I have came up with something below hope that many people will find this ...
Val's user avatar
  • 17.6k
1 vote
5 answers
65k views

Ok so here is the question. I am trying to insert a variable into my query that is pre-defined. However it is not working. The query works if I just give it a value, but when I insert a variable into ...
Chris's user avatar
  • 461
-2 votes
5 answers
3k views

I have a website where I use PHP in server side and mysql as database. I use the following script to retrieve data from database. Could anybody let me know whether this code is vulnerable to injection ...
day_dreamer's user avatar
2 votes
4 answers
7k views

Possible Duplicate: Best way to prevent SQL Injection in PHP I just found that my website is vunerable. Since it's connected to a DB and have functions like: Register, Change Password, Notices, ...
Genesis's user avatar
  • 1,367
2 votes
2 answers
4k views

is there any alternatives in PDO as in mysql is mysql_real_escape_string? why we should set 'false' -> ATTR_EMULATE_PREPARES constant?
GAURAV MAHALE's user avatar
0 votes
4 answers
3k views

Possible Duplicate: Best way to prevent SQL Injection in PHP In my website users can submit posts and delete their posts. To delete a post, they follow the link /posts.php?deletid=X where X is ...
Lucas Matos's user avatar
  • 1,152

15 30 50 per page