This topic is locked

Button on Report page. Not able to get data from field.

2/20/2018 7:27:01 AM
PHPRunner General questions
R
riajul74 author

I have a Report Page. All users report showing on it. I need to update a singal row (users) data. I have added the button but not able to get the user ID from the field. Field is linked to ID and sown as Name on the field.




I need to get data from "Emp Number" to post on the button server quarry.
Not able to do it.
Also can't find the way. Please help me to solve it

M
mersintarim 2/20/2018

$sql = "SELECT "your username field name" FROM your_user_table_name WHERE UserName = '".$_SESSION["UserID"]."'";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);
$values["your_field"]=$data["username"];

R
riajul74 author 2/20/2018



$sql = "SELECT "your username field name" FROM your_user_table_name WHERE UserName = '".$_SESSION["UserID"]."'";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);
$values["your_field"]=$data["username"];


It's a report page. not a list page and i need to add an update button for each user's data update. session user mean logged in user. but i need to pull data from this report page employee id field.
It will be like something (as example?)

Update report_table set status = 2 where user_id = (get data from the row user id as like we do for datagrid on list page)

admin 2/20/2018

Reports normally work with aggregated data and you won't be able to use buttons there the same way you use it on regular List. So if you need to use buttons that work with grid data you need to use a List page.