Jump to content

Getting 'id' From Table Database Based On Logged In User For Link


brownstone4

Recommended Posts

Hi,

 

New to php coding and using Joomla and have a question about how to write a query to the database to create a new link. Basically I am trying to create a link on a page which will link to the 'item' page of logged in user. So at the moment the link below will link to the currently viewed item of another user.

<a href="<? echo JRoute::_('index.php?option=com_prod&view=item&id=' . $this->item->id); ?>

 

What I need to do is make the link go to the item of the user who is logged in when they click on it. In the database under '_prod_items' for example there is rows with the item id 'id' and the user id 'user_id'. The component functions in a way so that users can only create one 'item'. So how can I make a query to get that item 'id' to put in a link based on the 'user_id' that is logged in?

 

Thanks.

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.