I am trying to add a record in a table based upon the UID of a member in my Drupal site. I am doing this with a form that is on each member's page. For this to work properly, I need to use the UID in the mysql query. This is being included in the page with a in a Drupal block.
If I use $uid = $user->uid;, it will be my UID as admin. I need for it to populate with the UID of of the member whose page I am currently viewing.
Here's a little snippet of my code:
mysql_query("INSERT INTO profile_values (fid, uid, value) VALUES ('99','$uid', '$newcompany')");
I need to define $uid and this will work perfectly! (this is Drupal Commons, if that makes a difference)