Jump to content


Photo

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


  • Please log in to reply
1 reply to this topic

#1 annabug

annabug
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 25 March 2006 - 07:37 PM

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

#2 AV1611

AV1611
  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 25 March 2006 - 08:05 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users