Jump to content

CODE 1 and CODE 2


Bickey

Recommended Posts

I just did a simple modification to this code and it doesn't seem to work now.

CODE 1 works but CODE 2 doesn't. Could someone help me fix CODE 2.

 

CODE 1

mysql_query("INSERT INTO tbl (username, password, surname, firstname, nickname, company, street, suburb, postal, phone, email, product, status, id) VALUES ('$username', '$password', '$surname', '$firstname', '$nickname', '$company', '$street', '$suburb', '$postal', '$phone', '$email', '$product', '$status', '$id')");

 

CODE 2

$go =sprintf("INSERT INTO tbl (username, password, surname, firstname, nickname, company, street, suburb, postal, phone, email, product, status, id) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%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($nickname), mysql_real_escape_string($company), mysql_real_escape_string($streetx), mysql_real_escape_string($suburb), mysql_real_escape_string($postal), mysql_real_escape_string($phone), mysql_real_escape_string($email), mysql_real_escape_string($product), mysql_real_escape_string($status), mysql_real_escape_string($id));
$result = mysql_query($go);

 

Link to comment
https://forums.phpfreaks.com/topic/224293-code-1-and-code-2/
Share on other sites

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.