Skip to main content
Topic: HOW TO USE USER_ID or USER_NAME (Read 4629 times) previous topic - next topic

HOW TO USE USER_ID or USER_NAME

Hello, o need help, new here.

I need to filter in adding register un a table with the iddentified user. and this daes not work, why??

"SELECT nombre AS Responsable FROM responsables WHERE responsables.id = 'USER_ID' ORDER BY nombre ASC"

Thanks

 

Re: HOW TO USE USER_ID or USER_NAME

Reply #1
The USER_ID and USER_NAME are PHP Constants

Here is the correct way of doing it.
Code: [Select]
"SELECT nombre as Responsable from responsables where responsibles.id='" . USER_ID . "' ORDER BY nombre ASC" 

Regards