943,846 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 3545
  • PHP RSS
May 5th, 2009
0

mysql_real_escape_string ?

Expand Post »
Hi,

Me again...

Just wanted to know, i have this piece of code to enter the data from a registration form of mine into the user db.

I want to use the mysql_real_escape_string to help stop those evil people who enjoys hacking from hacking my DB

$query = "INSERT INTO userinformation (username, first_name, last_name, email, password, date_time) VALUES ('$username', '$first_name', '$last_name', '$email', '$password', '$date_time')";

could someone tell me where i need to put the mysql_real_escape_string function to stop it happening, i am not sure where i place it by or how i code it,

thank you,
genieuk
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
genieuk is offline Offline
149 posts
since Apr 2009
May 5th, 2009
0

Re: mysql_real_escape_string ?

PHP Syntax (Toggle Plain Text)
  1.  
  2. $username=mysql_real_escape_string($username);
  3.  
  4. write before the query

Click to Expand / Collapse  Quote originally posted by genieuk ...
Hi,

Me again...

Just wanted to know, i have this piece of code to enter the data from a registration form of mine into the user db.

I want to use the mysql_real_escape_string to help stop those evil people who enjoys hacking from hacking my DB

$query = "INSERT INTO userinformation (username, first_name, last_name, email, password, date_time) VALUES ('$username', '$first_name', '$last_name', '$email', '$password', '$date_time')";

could someone tell me where i need to put the mysql_real_escape_string function to stop it happening, i am not sure where i place it by or how i code it,

thank you,
genieuk
Reputation Points: 10
Solved Threads: 7
Junior Poster
sarithak is offline Offline
183 posts
since Aug 2008
May 6th, 2009
0

Re: mysql_real_escape_string ?

check out link..
http://in2.php.net/mysql_real_escape_string

hope will help you..
Reputation Points: 3
Solved Threads: 15
Posting Whiz
Aamit is offline Offline
341 posts
since Apr 2008
May 6th, 2009
0

Re: mysql_real_escape_string ?

This might also help.

Preventing SQL Injection
Reputation Points: 15
Solved Threads: 5
Junior Poster in Training
TopDogger is offline Offline
87 posts
since Aug 2005
May 6th, 2009
0

Re: mysql_real_escape_string ?

Click to Expand / Collapse  Quote originally posted by TopDogger ...
This might also help.

Preventing SQL Injection

Thank you, althou i sorted it that is a very good read. Much appreciated.

Thanks very much.
genieuk
Reputation Points: 10
Solved Threads: 0
Junior Poster
genieuk is offline Offline
149 posts
since Apr 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: MySQL/Directory Member Photo Upload script trouble ...
Next Thread in PHP Forum Timeline: Sending attached files in php





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC