Jump to content

update database using sprintf


droidus

Recommended Posts

I think you mean:

mysql_query(sprintf("UPDATE members SET Age = '%s'", mysql_real_escape_string($age)))

You might want to add a WHERE clause to that though, or you'll update all the rows in that table. For example:

UPDATE members SET age = '12' WHERE username = 'droidus'

 

so let me make sure that i have this right:

 

mysql_query(sprintf("UPDATE members SET Age = '%s' WHERE uname = $_SESSION[user]", mysql_real_escape_string($age)))

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.