简体   繁体   English

当我单击显示按钮时显示特定数据

[英]show specific data when i click show button

i have problem on how to display specific details only. 我对仅显示特定详细信息有疑问。 let say for example i have two table salessumarry and rsales and have this ff data for its table. 比方说,例如,我有两个表salessumarry和rsales,并且其表具有该ff数据。

data from rsales 来自销售的数据

id | name | last_name | age | salessumarry_id |
1  |gejel | rosenthal | 21  |        5        |

data from salessumarry (note: this data is from database display to my webpage) 来自salessumarry的数据(注意:此数据从数据库显示到我的网页)

id | or_no | sold_by | detail |
5  | 12456 |  fabbie | show   |
6  | 22222 |  nedy   | show   |

my problem is this. 我的问题是这个。 when i click "show" from my webpage it must select data from rsales where salessumarry_id = salessumarry.id. 当我从网页上单击“显示”时,它必须从rsales中选择数据,其中salessumarry_id = salessumarry.id。 let say for example i click show for id 5 the expected output must be something like this 假设例如,我单击显示ID 5的显示,预期输出必须是这样的

id | or_no | sold_by | detail |
5  | 12456 |  fabbie | show   |
id | name | last_name | age | salessumarry_id |
1  |gejel | rosenthal | 21  |        5        |
6  | 22222 |  nedy   | show   |

i put this in my "show" button but my idea is up to only this point. 我将其放在“显示”按钮中,但我的想法只有到此为止。 i don't have idea how to display details when i click show 我不知道如何在单击显示时显示详细信息

echo '<td style="border-color:#000000; border-style:solid; border-width:1px;"><div align="center"><a  href=displaydetail.php?id=' . $row['id'] .'>show</a></div></td>';

This is a basic way to accomplish what you are trying to do: 这是完成您要执行的操作的基本方法:

displaydetail.php
<?php
    // get salessumarry_id  from the URL
    $salessumarry_id = $_GET['id'];
    $query = "SELECT * FROM rsales WHERE salessumarry_id = '$salessumarry_id'";

    // use mysqli/pdo here to to execute the query 
    // and fetch the results into $results array and display it here:
    echo "id | name | last_name | age | salessumarry_id |<br>";
    echo $results['id']. " | ". $results['name']." | ".$results['last_name']." | ";
    echo $results['age']." | ".$results['salessumarry_id']." | ";
?>

Hope this helps. 希望这可以帮助。 This can be further improved but first you need to make sure that this part is working. 可以进一步改进它,但是首先您需要确保该部分正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 单击按钮显示/隐藏colspan特定行 - Show / Hide colspan a specific row at the click of a button 当我单击按钮并在模型弹出窗口中显示完整信息时 - When i click button and show Full information on model popup 单击按钮时如何显示文本字段? - How to show textfields when we click a button? 如何在单击按钮时显示特定的div? - How to show specific div when button was clicked? 我想使用laravel单击“添加到购物车”按钮时,将商品显示在购物车中吗? - I Want to show products items into shopping cart when i click add to cart button using laravel? 在 HTML 表中显示 XML 数据以单击按钮并在单击行时显示信息 - Display XML Data in an HTML Table for a button click and Show Information When Clicking On a row 单击“显示”时显示详细信息 - display details when i click “show” 单击时显示特定的 php 数据 - Show specific php data when clicked 如何编码这样的输出?当我单击特定的链接时,它将显示某种形式(不确定是否是形式) - How to code like this kind of output?When I click a specific link it will show some form(not sure if it is form) 当我单击评论系统javascript而不是jquery上的回复按钮时,显示textarea或div(在要回复的评论下方) - Show textarea or div (just below the comment to reply),when i click reply button on comment system javascript not jquery
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM