RON_ron Posted December 2, 2010 Share Posted December 2, 2010 I'm trying to incorporate mysql_real_escape_string to my existing script. But doesn't seem to work. Could someone point out what's the reason. $abc =sprintf("INSERT INTO my_db1 (username, password, firstname, company, email) VALUES ('%s', '%s', '%s', '%s', '%s'", mysql_real_escape_string($username), mysql_real_escape_string($password), mysql_real_escape_string($surname), mysql_real_escape_string($firstname), mysql_real_escape_string($company), mysql_real_escape_string($email))); $resultg = mysql_query($abc); Link to comment https://forums.phpfreaks.com/topic/220484-mysql_real_escape_string/ Share on other sites More sharing options...
trq Posted December 2, 2010 Share Posted December 2, 2010 Look at your code. You have 5 set string positions %s followed by 6 arguments containing mysql_real_escape_string. Your also missing the closing ) on your query. Link to comment https://forums.phpfreaks.com/topic/220484-mysql_real_escape_string/#findComment-1142360 Share on other sites More sharing options...
RON_ron Posted December 2, 2010 Author Share Posted December 2, 2010 simple as that! Thanks Thorpe. Link to comment https://forums.phpfreaks.com/topic/220484-mysql_real_escape_string/#findComment-1142374 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.