【发布时间】:2018-06-10 01:42:57
【问题描述】:
我不是编程人员,但在遥远的过去有过一些。 我的网站人刚刚移民,我需要自己在这里对以下 PHP 代码进行一些小改动。不值得为此招募开发人员。
它只是相关的“”mysql_fetch_row行。
目前这会返回表中 OWNER 字段完全匹配的所有行。 我需要更改它以匹配 OWNER 内容等于表字段的任何部分的位置,其中包含的每个项目都以 CSV 方式分隔。
例如,我需要在包含 owner1、owner2、owner3、owner4 等的字段中找到 owner3 输入匹配项
$rs = mysql_query("select
type,
ref,
date,
owner
from documents where account=" . quote($currentaccount) . " and owner=" . quote($owner) . " and type like 'CR%' order by entered desc");
echo '<table class="data" width="97%">';
while ($r = mysql_fetch_row($rs))
{
$i = 0;
echo '<tr>';
$type = $r[$i++];
echo '<td>';
echo esc($type);
echo '</td>';
$ref = $r[$i++];
echo '<td>';
echo '<a href="download.php?type=' . escurl($type) . '&ref=' . escurl($ref) . '">' . esc($ref) . '</a>';
echo '</td>';
$s = $r[$i++];
echo '<td>';
echo strdate($s);
echo '</td>';
$s = $r[$i++];
echo '<td align="right">';
echo blankzero($s);
echo '</td>';
echo '</tr>';
}
echo '</table>';
require '../inc/end.php';
【问题讨论】:
-
您在数据库字段中看到 csv 格式了吗?你能显示一个示例行吗
标签: php mysql html-table