Jump to content

User Location


Ads

Recommended Posts

This is Probabaly the most obvious thing, but i seem to overlook it :(

 

I am trying to make a online users list, That i have made na ti works well, within the user list i am trying to add a section that display the current page the user is on.

 

On each page I am adding:

include "globals.php";
$page = "Home";

and then within the globals page I have:

global $page;
$db=mysql_query("UPDATE users SET location = '$page' WHERE userid=$ir[userid]");

 

But it Doesn't Update the Database at all. The Globals.php is included in every single page.

 

Any Help would be Great :D

Link to comment
https://forums.phpfreaks.com/topic/202240-user-location/
Share on other sites

This is Probabaly the most obvious thing, but i seem to overlook it :(

 

I am trying to make a online users list, That i have made na ti works well, within the user list i am trying to add a section that display the current page the user is on.

 

On each page I am adding:

include "globals.php";
$page = "Home";

and then within the globals page I have:

global $page;
$db=mysql_query("UPDATE users SET location = '$page' WHERE userid=$ir[userid]");

 

But it Doesn't Update the Database at all. The Globals.php is included in every single page.

 

Any Help would be Great :D

 

Try changing your query to the following:

 

$db=mysql_query("UPDATE users SET location = '$page' WHERE userid=".$ir['userid']);

 

Link to comment
https://forums.phpfreaks.com/topic/202240-user-location/#findComment-1060496
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.