Skip to main content
deleted 214 characters in body; edited tags; edited title
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

How todo I get the username of the logged-in user name for doing mysql query?

I am new to Drupal so a little help would be appreciated.

I am working on a site where on onea page I am doing a mysql query ofquerying some data related to my project.

Here I have many clients and I have given all of them access to project search page. On search page I run a mysql query according to the fields selected by the user using php and display the result as a table on the page itself. But my mysql query is as such that it is not user dependent.

I just want to ensure that each user has a specific set of output for itself (i.e not all the table would be displayed to all users).

For that i need to know how toHow do I get the user_nameusername or user_IDuser ID of the specific logged in-in user and to use that in myquery.

Can anyone help me solve out this problem of mine?

How to get user name for doing mysql query?

I am new to Drupal so a little help would be appreciated.

I am working on a site where on one page I am doing a mysql query of some data related to my project.

Here I have many clients and I have given all of them access to project search page. On search page I run a mysql query according to the fields selected by the user using php and display the result as a table on the page itself. But my mysql query is as such that it is not user dependent.

I just want to ensure that each user has a specific set of output for itself (i.e not all the table would be displayed to all users).

For that i need to know how to get the user_name or user_ID of the specific logged in user and to use that in myquery.

Can anyone help me solve out this problem of mine?

How do I get the username of the logged-in user?

I am working on a site where on a page I am querying some data related to my project.

Here I have many clients and I have given all of them access to project search page. On search page I run a query according to the fields selected by the user and display the result as a table on the page itself. But my query is as such that it is not user dependent.

I just want to ensure that each user has a specific set of output for itself (i.e not all the table would be displayed to all users).

How do I get the username or user ID of the logged-in user?

Source Link

How to get user name for doing mysql query?

I am new to Drupal so a little help would be appreciated.

I am working on a site where on one page I am doing a mysql query of some data related to my project.

Here I have many clients and I have given all of them access to project search page. On search page I run a mysql query according to the fields selected by the user using php and display the result as a table on the page itself. But my mysql query is as such that it is not user dependent.

I just want to ensure that each user has a specific set of output for itself (i.e not all the table would be displayed to all users).

For that i need to know how to get the user_name or user_ID of the specific logged in user and to use that in myquery.

Can anyone help me solve out this problem of mine?