Jump to content

clickable links in a table & pulling info for logged in user only


annabug

Recommended Posts

Hi all.

I'm still learning all of this so please bear with me. I need ideas / suggestions / help on the following.

I'm creating a database driven site where, once the client is logged in, he will be redirected to a user-specific page. On this page, I want to be able to call up just that current logged in user's orders / purchases. The orders will be displayed in a table with clickable links. When a user clicks on, say, the purchase order number, he will be taken to a page that displays the info for just that purchase.

I have my database set up.

I have my backend set up for non-admin entering of data for the table.

What I'm looking for is:

1) how to code it so it does a 'SELECT' of just the data for the user that's logged in. Was thinking something along this line but my syntax and such is wrong somewhere.

$sql = 'SELECT * FROM 'orders' WHERE 'acct_name' = \'hills\' (hills = logged in user)


2) Once the data is pulled in, I need to make the data clickable and redirect to the purchase-specific page. This one has me stumped.


I'm on my way to the book store to pick up yet another book with hopes of finding solutions.

Any and all help or direction toward help is more than appreciated.

Thank you so much!

-- Anna in WA
Link to comment
Share on other sites

Will this do it? You will have to make a page called podisplay.php that takes the specific PO Number and displays the data for it...


While($row=mysql_fetch_array($result)){
echo '<a href="podisplay.php?po=' . $row['ponumber'] . '>' . $row['ponumber'] . '</a>"';
}

I guessed at field names, but I hope you get the idea...
Link to comment
Share on other sites

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.