Php: how to make variables work in mysql instructions -
I am trying to create one last online system and this is the code that must be run after login
$ name = $ user ['username'] mysql_query ("utidad user set last_action = now () WHERE username = $ name"); $ Message = "connected";
In general, if I type this code in the php tag the name is displayed
resonance $ user ['username'] < / Code>
but it seems that this variable does not work in mysql_query
Why? How should I set "$ name" to do this work?
You will need to type '$ name'
. Try:
mysql_query ("UPDATE user SET last_activity = now (WHERE user name = '$ name'");
Comments
Post a Comment