clown[NOR] Posted April 11, 2007 Share Posted April 11, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/46617-solved-why-isnt-my-insert-into-working-now/ Share on other sites More sharing options...
sasa Posted April 11, 2007 Share Posted April 11, 2007 you miss last ) in line . mysql_real_escape_string($mfm_NewImgName) . "')" // <-- this line Quote Link to comment https://forums.phpfreaks.com/topic/46617-solved-why-isnt-my-insert-into-working-now/#findComment-226980 Share on other sites More sharing options...
clown[NOR] Posted April 11, 2007 Author Share Posted April 11, 2007 awsome... i'm blind.. thanks mate.. off to try it again *EDIT* Working perfect now =) again..thanks Quote Link to comment https://forums.phpfreaks.com/topic/46617-solved-why-isnt-my-insert-into-working-now/#findComment-226983 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.