0
我需要比较两个表,其中一个有数据,另一个有解释。比较两个表与通配符
所以数据表看起来像这样:
id | state | substate | stage | suppressed
001 wip A1 B3 Y
003 wip A1 B1 N
005 done A2 B3 Y
009 wip A1 B3 N
... and many more similar
解释表具有以获得上面的4个状态(状态,子状态中,阶段,抑制),并将它们转换为人类可读:
state | substate | stage | suppressed | HRoutput1 | HRoutput2
wip A1 B1 N "it's ok" "wait...dont do anything"
wip A1 B3 N "it's not ok" "better call saul"
done A2 B3 Y "it's not ok" "forget about it"
wip A1 B1 Y "it's ok" "something minor needs to be done"
* * * Y "it's ok" "it's suppressed"
done * * * "it's ok" "it's being worked on"
现在看到,在上述说明表具有2个阶段,其中i使用通配符在表
*,*,*,Y,"it's ok","its suppressed"
当状态,子状态,阶段和抑制在上述任何标准中不匹配时应使用此项。
我做了什么直到现在,我装上的数据每行到一个数组A 然后让元件阵列通过解释表A中运行:
"SELECT * from explanation_table where state = '" . $data['state'] ."' and '" . $data['substate'] . "' ....etc etc
然后运行查询和保存结果到一个解释阵列并打印结果
$data['id'] . $expl['HRoutput1'] . $expl['HRoutput2']
我的代码工作正常,除了通配符的情况。
哦哇!会尝试一下:) –