Jump to content

[SOLVED] why isnt my INSERT INTO working now?


clown[NOR]

Recommended Posts

well... i first made a code... then I had to change it cuz it was open for SQL injection...

 

this is the first code i had (it worked)

$query = "INSERT INTO mfm_movies VALUES ('', '$mfm_TITLE', '$mfm_AGE', '$mfm_GENRE', '$mfm_RELEASE', '$mfm_KEYWORDS', '$mfm_RATING', '$mfm_REVIEW', '$mfm_NewImgName')";
$result = mysql_query($query);

 

now after searching on google for sql injection i ended up on wikipedia, and they gave a sample code, and it worked perfect in my login.php... but when I added the same code to addmovies.php and modified it to fit the use, it doesn't work...

 

this is how it looks now

	$result = mysql_query(
	"INSERT INTO mfm_movies VALUES ('', '" 
	. mysql_real_escape_string($mfm_TITLE) . 
	"', '" 
	. mysql_real_escape_string($mfm_AGE) . 
	"', '" 
	. mysql_real_escape_string($mfm_GENRE) . 
	"', '" 
	. mysql_real_escape_string($mfm_RELEASE) . 
	"', '" 
	. mysql_real_escape_string($mfm_KEYWORDS) . 
	"', '" 
	. mysql_real_escape_string($mfm_RATING) . 
	"', '" 
	. mysql_real_escape_string($mfm_REVIEW) . 
	"', '" 
	. mysql_real_escape_string($mfm_NewImgName) . 
	"'"
);

 

any ideas?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.