gpt4 book ai didi

php - 来自 mysql 路径和带有树形菜单的 php 的图片库

转载 作者:行者123 更新时间:2023-11-30 00:32:56 25 4
gpt4 key购买 nike

我有这种情况(mysql + php):

mysql:

    `| employee | visitday   | customername | picnumber | picpath   |
----------------------------------------------------------------
| agent 1 | 2014-02-16 | customer | 1 |c:\....jpg |
| agent 2 | 2014-01-11 | customer | 1 |c:\....jpg |`

在我的网站中,我有一个像这样的树形菜单:员工 -> 访问日 -> 客户名,基于 mysql

当我单击客户名称打开包含客户图片的图片库时,我该如何执行此操作。

谢谢。

最佳答案

我猜你有某种名为 customer.php 的文件

因此菜单中该客户的链接可能类似​​于:customer.php?name=customername

然后在 customer.php 中使用以下内容:

<?php
$customer = $_GET['name'];

if(isset($customer) && !empty($customer)) {
$query = mysql_query("SELECT `id`, `customername`, `picpath` FROM `the table name` WHERE `customername` = '$customer'");


echo '<table>
<tr> <th>Foto</th> </tr><tr>';
while( $associate = mysql_num_rows($query)) {
echo '<td><img src="'.$associate['picpath'].'"></td>
</tr><tr>';
}
echo '</tr>
</table>';
} else {
header('Location: index.php');
exit();
}
?>

关于php - 来自 mysql 路径和带有树形菜单的 php 的图片库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22381689/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com