Displaying a table result per user

Great combo eh? Post your questions about them here :)

Displaying a table result per user

Postby eball on Thu Nov 20, 2008 5:17 pm

I have a form on my website that users fill out daily. I have 2 comment fields in the same database table for administrator comments on each particular form, which are added via a separate report view.

What I'd like to do is display 'admin_comment_1' on the users homepage (members.php) when they log in. I've done some reading on sql and have come up with the following query;
Code: Select all
SELECT LAST(admin_comment_1) FROM table_name WHERE email=$email

Would I then use
Code: Select all
$email=$qls->user_info['email'];
$comment=$_GET['admin_comment_1'];

To grab user's email and the appropriate admin comment?

I'm trying to feel my way through this, and sometimes I run blind ;)

Thanks,

Eball
eball
New
 
Posts: 2
Joined: Wed Oct 22, 2008 7:26 am

Re: Displaying a table result per user

Postby eball on Thu Nov 20, 2008 8:10 pm

I figured it out guys, thanks anyway :)

Used this and it worked great!
Code: Select all
$selectSql = "SELECT LAST row_name FROM  table_name".
'         WHERE  user_email="'.addslashes($qls->user_info['email']).'"';

$Result    = $MyDb->f_ExecuteSql($selectSql);
$Resultset = $MyDb->f_GetRecord($Result);
?>

<?php echo $Resultset['row_name'];?>
eball
New
 
Posts: 2
Joined: Wed Oct 22, 2008 7:26 am

Re: Displaying a table result per user

Postby Josh on Thu Nov 20, 2008 9:52 pm

Congrats on figuring it out yourself eball. Lol

I'm terribly sorry for not being available to respond to your post quicker.

Spread the word :)
Josh
Site Admin
 
Posts: 476
Joined: Mon Nov 05, 2007 7:30 pm
Location: California


Return to PHP and MySQL

Who is online

Users browsing this forum: No registered users and 0 guests

cron