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! Quote Link to comment 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. Quote Link to comment 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); Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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! Quote Link to comment 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.