Jump to content

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


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.