RON_ron Posted December 2, 2010 Share Posted December 2, 2010 Could someone tell what's wrong here? $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); Thanks! Link to comment https://forums.phpfreaks.com/topic/220455-coding-error-mysql_real_escape_string/ Share on other sites More sharing options...
mikecampbell Posted December 2, 2010 Share Posted December 2, 2010 mysql_real_escape_string($password, mysql_real_escape_string($surname, mysql_ ... It looks like you're missing some brackets. Link to comment https://forums.phpfreaks.com/topic/220455-coding-error-mysql_real_escape_string/#findComment-1142168 Share on other sites More sharing options...
RON_ron Posted December 2, 2010 Author Share Posted December 2, 2010 Thanks. But the adding the missing brackets did not solve the issue. $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/220455-coding-error-mysql_real_escape_string/#findComment-1142192 Share on other sites More sharing options...
mikecampbell Posted December 3, 2010 Share Posted December 3, 2010 It would be helpful to know in what way it isn't working, and what error message you're getting. Link to comment https://forums.phpfreaks.com/topic/220455-coding-error-mysql_real_escape_string/#findComment-1142520 Share on other sites More sharing options...
OldWest Posted December 3, 2010 Share Posted December 3, 2010 Is your database connection working OK? Yeah you really need to post the error message up here. Link to comment https://forums.phpfreaks.com/topic/220455-coding-error-mysql_real_escape_string/#findComment-1142540 Share on other sites More sharing options...
robert_gsfame Posted December 3, 2010 Share Posted December 3, 2010 What error shown up?? $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); this is what i notice...try this $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); surely it works! Link to comment https://forums.phpfreaks.com/topic/220455-coding-error-mysql_real_escape_string/#findComment-1142644 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.