mysql_real_escape_string ?

Thread Solved

Join Date: Apr 2009
Posts: 119
Reputation: genieuk is an unknown quantity at this point 
Solved Threads: 0
genieuk genieuk is offline Offline
Junior Poster

mysql_real_escape_string ?

 
0
  #1
May 5th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 150
Reputation: sarithak is an unknown quantity at this point 
Solved Threads: 6
sarithak sarithak is offline Offline
Junior Poster

Re: mysql_real_escape_string ?

 
0
  #2
May 5th, 2009
  1.  
  2. $username=mysql_real_escape_string($username);
  3.  
  4. write before the query

Originally Posted by genieuk View 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
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 293
Reputation: Aamit has a little shameless behaviour in the past 
Solved Threads: 11
Aamit Aamit is offline Offline
Posting Whiz in Training

Re: mysql_real_escape_string ?

 
0
  #3
May 6th, 2009
check out link..
http://in2.php.net/mysql_real_escape_string

hope will help you..
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 87
Reputation: TopDogger is an unknown quantity at this point 
Solved Threads: 5
TopDogger's Avatar
TopDogger TopDogger is offline Offline
Junior Poster in Training

Re: mysql_real_escape_string ?

 
0
  #4
May 6th, 2009
This might also help.

Preventing SQL Injection
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 119
Reputation: genieuk is an unknown quantity at this point 
Solved Threads: 0
genieuk genieuk is offline Offline
Junior Poster

Re: mysql_real_escape_string ?

 
0
  #5
May 6th, 2009
Originally Posted by TopDogger View Post
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
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC